Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

The socket async read worker shuts down when it has no callbacks now.

  • Loading branch information...
commit 3b416b8eb8a9e9420229d1bc0b15dd1c39b6aa32 1 parent c377aea
John Brochue Arke64 authored
Showing with 3 additions and 8 deletions.
  1. +3 −7 Socket.c
  2. +0 −1  Socket.h
10 Socket.c
View
@@ -403,12 +403,8 @@ void SAL_Socket_UnsetSocketCallback(SAL_Socket* socket) {
socket->ReadCallbackState = NULL;
AsyncLinkedList_Remove(&asyncSocketList, socket);
- }
-}
-/**
- * Clears all the registered callbacks.
- */
-void SAL_Socket_ClearCallbacks(void) {
- SAL_Socket_CallbackWorker_Shutdown();
+ if (AsyncLinkedList_GetCount(&asyncSocketList) == 0)
+ SAL_Socket_CallbackWorker_Shutdown();
+ }
}
1  Socket.h
View
@@ -37,6 +37,5 @@ public uint32 SAL_Socket_Read(SAL_Socket* socket, uint8* const buffer, const uin
public uint32 SAL_Socket_Write(SAL_Socket* socket, const uint8* const toWrite, const uint32 writeAmount);
public void SAL_Socket_SetReadCallback(SAL_Socket* socket, SAL_Socket_ReadCallback callback, void* const state);
public void SAL_Socket_UnsetSocketCallback(SAL_Socket* socket);
-public void SAL_Socket_ClearCallbacks(void);
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.