Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Another interface approach would be to have a very minimalist callback interface where the socket ID is handed back in the callback.

This should be enough to make the different operating systems look the same but avoid the problem with not separating the concern of dispatch callbacks to the lifetime of the sockets.

The interface could look something like this:

typedef void (*NETsocketCallback)(int SocketId);
void NETsetSocketWriteCallback(NETloopHandle LoopHane, NETsocketCallback pCallback);
void NETsetSocketReadCallback(NETloopHandle LoopHane, NETsocketCallback pCallback);
void NETsetSocketErrorCallback(NETloopHandle LoopHane, NETsocketCallback pCallback);

Advantage of this model is possibly being more compatible with how IOCP works? Questions remain about how errors and socket closing would work in this model.

One might consider using COLclosures or similar callback mechanisms?

  • No labels