|
||||||||
|
|
#1
|
|
I've got a problem that I don't know how to get around. I've written a client socket application in C, but I'm having problems getting it to work properly. I have a separate thread that reads the socket and puts the data in a buffer. The main thread looks for data and processes it accordingly. There is a ppp connection over an unreliable network. If the main thread doesn't get an application level ack to data sent, it closes the socket, restarts ppp, and opens a new socket when ppp is up again. Sometimes the new socket works, sometimes it doesn't. Sometimes the tcp-read gets a read of 0 bytes indicating that the connection is closed, and all is well. But sometimes it remains blocked, so the application writes to the new socket, but is blocked on the old. I'm not sure how to get around this. I'm probably doing it all wrong. Any suggestions would be appreciated, or any links to some example code. There are lots of simple socket examples, but I haven't been able to find anything to help me in this situation. Thanks Dan Dan N |
![]() |
| Tags |
| problem, progamming, socket |
| Thread Tools | |
| Display Modes | |
|
|