Calling bsdsocket.library functions can use quite some stack and different amounts depending on what it does.
If you are using the stack to some extent in your code, try increasing the stack size above the standard 4kB and see if it solves the problem, it is a very cheap thing to test.
|