Problem with sockets and SDL

Started by
1 comment, last by hplus0603 18 years, 4 months ago
blah
Advertisement
The call to recv blocks until data is available. If you call recv on the same thread that does the rendering, your screen will not be updated.
To solve this, you can either use non-blocking I/O (Google has quite some arctiles on that), or run your network and rendering code in separate threads.

.

Also, you should test the return value from recv(), because if there's some error, your loop will spin forever.
enum Bool { True, False, FileNotFound };

.

This topic is closed to new replies.

Advertisement