Some time ago I wrote a message on plauyerstage-developers that I'm experiencing errors with server<->server communications. Finally I found some time for a deeper investigation and found that it had to be caused by recent WIN32-compatibility improvements. There are two solutions for this:
1. Use recv() instead of read() on unixes, as in other parts of Player (see libplayerc code) - that is what I'm doing in my patch (whenever WIN32 is not defined); note that communication errors are indicated different way on different unixes (different sets of errno constants), but one thing is sure: if communication is broken, recv() returns 0 (we can assume then, -1 means no data available).
2. Do not use non-blocking sockets, in this cause read() behaves much the same way on WIN32 and unixes. We may use select() or poll() instead of relying on non-blocking communication, however, I don't know how it should be done on WIN32. Therefore I have choosen solution 1 which was easier to implement.
This solved my server<->server communication problems.
Log in to post a comment.