Do not share SocketBase across tasks

Issue #113 resolved
Tygre repo owner created an issue

I was using the Miami SDK. Naively, I used to declare a global SocketBase shared across files… and tasks! This sharing across tasks sometimes would cause crashes when two tasks were using a same SocketBase. These crashes became obvious when I tried to factor out the code opening the library. I should have RTFM’ed: it clearly states that “The recommended approach, if several Processes need to use the "bsdsocket.library" functions, is to reopen the library for every user.”
Make sure that tasks do not share a common SocketBase!

Comments (4)

  1. Tygre reporter

    The solution is (1) replace the Miami SDK with the Roadwho one, which allows compiling with SocketBase global variable and (2) use the TASKSOCKBASE include to define SocketBase as FindTask(NULL)->tc_UserData.

  2. Log in to comment