Socket programming examples wanted

johnl johnl at tw-rnd.SanDiego.NCR.COM
Tue Oct 17 03:35:23 AEST 1989


	I would like to get some sample code illustrating the use of sockets
in a client/server model.  I am using Internet domain, stream sockets and am
having some trouble.

In my example code:
------------------
1. The server creates/binds/listens on a socket with a well-known port number
2. The client creates a socket and connects to the server's socket.
3. The client sends a message.
4. The server (using select) detects the incoming message,
                          calls accept to get a new file descriptor,
                          forks a child which calls recv to read the message,
                          child closes it's (new) socket and dies.
5. Goto 3.

	The first message is transferred correctly, but subsequent messages
are "lost".  Any help or sample code appreciated!  I can email the code to
anyone interested in helping me debug.  Thanks!!

-- 
----------------------------------------------------------------------
John Lindwall                            johnl at tw-rnd.SanDiego.NCR.COM
           "Above opinions are my own, not my employer's"
PenPal V1.1 for sale: $90.  All original disks, manual, box.  Registration.



More information about the Comp.unix.questions mailing list