Re: einfache TCP/IP konstruktion

Oliver Block <[email protected]>
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
Am Samstag, 20. Mai 2006 02:18 schrieb Jan Hendrik Berlin:
> moin!
>
> hat irgendjemand fÃŒr mich einen "Rahmen" fÃŒr nen server und nen client,
> die ÃŒber TCP/IP Daten austauschen? 

client:
-------
1. Find the IP address and protocol port number of the server with which 
communication is desired.
2. Allocate a socket.
3. Specify that the connection needs an arbitrary, unused protocol port on the 
local machine, and allow TCP to choose one.
4. Connect the socket to the server.
5. Communicate with the server using the application-level protocol (this 
usually involves sending requests and awaiting replies).
6. Close the connection.

server
-------
1. Create a socket and bind to the well-known address for the service being 
offered.
2. Place the socket in passive mode, making it ready for use by a server.
3. Accept the next connection request from the socket, and obtain a new socket 
for the connection.
4. Repeatedly read a request from the client, formulate a response, and send a 
reply back to the client according to the application protocol.
5. When finished with a particular client, close the connection and return to 
step 3 to accept a new connection.

Quelle: Douglas E. Comer/ David L. Stevens: Internetworking With TCP/IP. Vol 
III; Client-Server Programming And Applications.

Gruß,

Oliver



-- 
Um die Liste abzubestellen, schicken Sie eine Mail an:
    [email protected]
Um eine Liste aller verfÃŒgbaren Kommandos zu bekommen, schicken
Sie eine Mail an: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.