Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 3b416b8eb8a9e9420229d1bc0b15dd1c39b6aa32 1 parent c377aea
John authored

Showing 2 changed files with 3 additions and 8 deletions. Show diff stats Hide diff stats

  1. +3 7 Socket.c
  2. +0 1  Socket.h
10 Socket.c
@@ -403,12 +403,8 @@ void SAL_Socket_UnsetSocketCallback(SAL_Socket* socket) {
403 403 socket->ReadCallbackState = NULL;
404 404
405 405 AsyncLinkedList_Remove(&asyncSocketList, socket);
406   - }
407   -}
408 406
409   -/**
410   - * Clears all the registered callbacks.
411   - */
412   -void SAL_Socket_ClearCallbacks(void) {
413   - SAL_Socket_CallbackWorker_Shutdown();
  407 + if (AsyncLinkedList_GetCount(&asyncSocketList) == 0)
  408 + SAL_Socket_CallbackWorker_Shutdown();
  409 + }
414 410 }
1  Socket.h
@@ -37,6 +37,5 @@ public uint32 SAL_Socket_Read(SAL_Socket* socket, uint8* const buffer, const uin
37 37 public uint32 SAL_Socket_Write(SAL_Socket* socket, const uint8* const toWrite, const uint32 writeAmount);
38 38 public void SAL_Socket_SetReadCallback(SAL_Socket* socket, SAL_Socket_ReadCallback callback, void* const state);
39 39 public void SAL_Socket_UnsetSocketCallback(SAL_Socket* socket);
40   -public void SAL_Socket_ClearCallbacks(void);
41 40
42 41 #endif

0 comments on commit 3b416b8

Please sign in to comment.
Something went wrong with that request. Please try again.