Hi,
I'm working on upgrading LinuxDC++'s client to that of DC++ 0.687 and I have a problem.
In Socket::create() (Socket.cpp:76) there is a call to setBlocking(true).
If this call is enabled the client dies on startup since socket::read will return EWOULDBLOCK (-1) and this will be forwarded to SearchManager::onData() and here std::string will throw an error. If I comment this call everything "works" except that every time I would expect to se "No Slots Available" from a user I get "SocketException: Disconneted" in the transferview and "BufferedSocket: New command when already failed: 1" on std::out (BufferedSocket::checkEvents(), BufferedSocket:395). Is this a behavior that the windows client has too? Or does any of you know what is going on here?
/Thanks Naga
Socket issue
Moderator: Moderators
Socket issue
Thanks to all open source programmers!
They enable the rest of us to learn a lot!
They enable the rest of us to learn a lot!
linux handles blocking a bit differently
setsockopt() call needed to set blocking / non-blocking sockets is different for
windows/linux. Afaik, setblocking(true) will make ::read call wait till data is available. It will not return -1 EWOULDBLOCK... search network code for checksocket() and wrap your network reads into it.
windows/linux. Afaik, setblocking(true) will make ::read call wait till data is available. It will not return -1 EWOULDBLOCK... search network code for checksocket() and wrap your network reads into it.