Advertisement

Problem with sockets and SDL

Started by December 05, 2005 08:45 AM
1 comment, last by hplus0603 19 years, 2 months ago
blah
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.
Advertisement

.

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