Topic: C# Wrapper - Set non-blocking I/O

Greetings,

I'm trying to use the c# wrapper to build a little client for a game using DTLS. The only problems is that I need to have a non-blocking setup, since it's mandatory for the application. I know there is the wolfSSL_set_using_nonblock function in the native library, but I can't find any similiar one inside the c# wrapper.

Then, the question is:
Is there any way to set non-blocking I/O in c#?

Thanks!

Share

Re: C# Wrapper - Set non-blocking I/O

Hi Ivanchez,

There is not yet a wrapping of the function wolfSSL_set_using_nonblock in the C# wrapper. It would be similar to how the function wolfSSL_get_error is wrapped in wolfSSL.cs but would the function would need to be added in. With the C# wrapper the examples are currently set up to use blocking sockets (https://github.com/wolfSSL/wolfssl/blob … SL.cs#L454) so the IO callbacks would also need to be set up for the project. An example of setting the IO callback can be found here https://github.com/wolfSSL/wolfssl/tree … Callbacks.

What are the time frames with building the game for when it would be needed?

Regards,
Jacob

Share

3 (edited by Ivanchez 2017-07-11 16:26:39)

Re: C# Wrapper - Set non-blocking I/O

Hi Jacob,

Thanks for your answer, the game is in a really early state, I am just setting the barebones of the server/client network exchange, so there is no hurry yet.

Actually, I have managed to get the client working on multithreading (the client was the problem) so maybe I would be able to sort out the problem, having the blocking functions (wolfssl.accept(), etc.) being called in a separate thread, so maybe I won't need the non-blocking setup, but it's not definitive as I haven't tested yet a real connection between server and client.

Anyway it would be nice to have this funcionality wrapped in future releases, by now I will be dealing with C# threading and wolfssl. Would you think I should expect major problems with these two working together?

Thanks a lot! I'll reply with news.

Share