einfache TCP/IP konstruktion
moin! hat irgendjemand für mich einen "Rahmen" für nen server und nen client, die über TCP/IP Daten austauschen? Also Ich möchte ein byte an den server schicken können, und das dann entsprechend weiterverarbeiten! Ich hab leider noch kein vernünftiges funktionierendes Beispiel gefunden. Danke Jan
Hallo, Am Sam, 20 Mai 2006, Jan Hendrik Berlin schrieb:
hat irgendjemand für mich einen "Rahmen" für nen server und nen client, die über TCP/IP Daten austauschen?
Fuer perl: perldoc Net::Server, perldoc Net::Server::INET, perldoc Net::TCP::Server, perldoc NetServer::Generic -dnh -- My word processor was written by Stanford Professor Donald Knuth. Who wrote yours?
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
participants (3)
-
David Haller
-
Jan Hendrik Berlin
-
Oliver Block