1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-10-19 21:30:53 +00:00

Refactored polling, lpolllist.c now handles poll events & flushes the poll queue

- Sockets now have event callbacks, onPollIn, onPollOut & onPollFail. If these are set to NULL they're ignored
This commit is contained in:
2022-03-24 10:26:06 -05:00
parent 94bcabadfd
commit 7baced7b8f
9 changed files with 110 additions and 83 deletions

View File

@@ -37,8 +37,12 @@ void laikaS_cleanUp(void) {
#endif
}
void laikaS_initSocket(struct sLaika_socket *sock) {
void laikaS_initSocket(struct sLaika_socket *sock, pollEvent onPollIn, pollEvent onPollOut, pollFailEvent onPollFail, void *uData) {
sock->sock = INVALID_SOCKET;
sock->onPollFail = onPollFail;
sock->onPollIn = onPollIn;
sock->onPollOut = onPollOut;
sock->uData = uData;
sock->inBuf = NULL;
sock->inCap = ARRAY_START;
sock->inCount = 0;