[lug] [OT] Threads & Socket Programming

David Morris lists at morris-clan.net
Thu Oct 24 16:27:12 MDT 2002


Sorry this is a tad OT, but:

I haven't found any good web sites *or* mailing lists yet on
this question, so I am hoping someone can point me to a good
email list, or perhaps even answer the qustion directly.  If
you want to help directly, please email off-list so we don't
annoy everyone with the OT traffic.

I am working on an application that uses queue of packets to
send out over a socket.  Writing to the socket is handled by
a thread sepperate from the main application. (FYI, language
is C++)

Everything works fine, except that if I write too many
packets to the socket too fast, I loose data packets (never
received by the client side).  I can solve this problem by
putting in a sleep(1) statement, but that kind of defeats
the purpose of having a thread to handle writing data to the
socket from the queue.

Anyone know why I would be having this problem?  Do I need
to call some function to poll the socket and find out if
data can be sent out yet, or if I have to wait (thought such
blocking was handled automatically).

Thanks for any input you can give on solutions, or other
lists to ask.

--David




More information about the LUG mailing list