Networking Forums

Networking Forums > Computer Networking > Linux Networking > Socket Progamming Problem

Reply
Thread Tools Display Modes

Socket Progamming Problem

 
 
Dan N
Guest
Posts: n/a

 
      04-13-2006, 09:14 AM

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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket Shutdown problem Valerie Hough Windows Networking 0 11-10-2006 09:17 AM
Socket problem Honjo Windows Networking 0 02-29-2004 11:48 PM
Linux Socket Problem? LaBird Linux Networking 2 02-23-2004 07:04 AM
TCPIP Socket problem ddriver@rrcol.com Windows Networking 1 12-11-2003 01:26 PM
socket problem Charles Linux Networking 0 11-09-2003 08:46 PM



1 2 3 4 5 6 7 8 9 10 11