unable to browse shares
Submitted by ignoramus on Tue, 04/10/2012 - 05:24
Forums:
I'm often not able to browse shares of online users (including myself). When I click "browse user's files", I'm just left hanging indefinitely. Well, sometimes it works and sometimes it doesn't. I've got my port forwarding set up properly, as far as I know. What could be the cause of this?
- Log in to post comments
File shares, often being
File shares, often being rather big, can take a while to transmit. That being the case it's not unusual for the peer message containing the file share to be interrupted mid-send. Part of the problem is that it can be tricky to tell whether a large peer message is in the process of being sent or received, which can cause the peer socket to time out before transmission is complete. In SoulseekQt, I know when parts of a large message are being received, and I can use that to update the last activity timestamp to make sure the client doesn't close the connection prematurely. Sending appears to be more complicated. Qt simply buffers everything you want to send and lets you know when it's all done, so you can't really tell if the message is still being sent. Another possibility is that the share browse request itself is sent on a defunct connection. Qt abstracts socket functionality to such a degree that it's not really possible to tell if a message was sent or not before the connection closed. Even if you have a dedicated thread for each peer connection where you're blocking on each socket write operation to see whether it completes successfully or not, it's never clear with Qt whether a send was deemed to be successful because the data was written to the device buffer, or whether it was actually acknowledged by the remote side which is what we would be interested in.