DelphiFAQ Home Search:

Client / Server programming - generic steps to start a server or a client

 

comments2 comments. Current rating: 5 stars (2 votes). Leave comments and/ or rate it.

Client/server network programming requires a server running on one machine to listen and answer requests and one or more clients running either on the same machine or different machines connected to the server through a network.

Independent from your operating system and programming language, you'll have to follow the following basic steps to create and run a server (the function refers to the unix naming convention; almost all languages have interfaces to them):

  1. Create a socket with socket
  2. Bind the socket to a port address with bind
  3. Listen to the socket at the port address with listen
  4. Accept client connections with accept

Creating a client involves less steps:
  1. Create a socket with socket
  2. Connect the socket to the remote machine with connect


Most modern environments offer classes, components, beans, Active-X controls.. libraries.. to abstract this process but it's good to know the basic steps that happen behind the scenes in case you get an error message 'Cannot bind socket'.. 'port already in use'.


Comments:

2006-10-07, 18:12:50
anonymous from Bulgaria  
rating
2008-04-16, 14:28:03
adel_fayez7@yahoo.com  
rating
hi i am adel_fayez7@yahoo.com

 

 

Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option.
 
It seems that you are
from Washington, US .

Info/ Feedback on this

Show city and country
Show country only
Hide my location
Leave your comment here:
Please type in the code:
photo Add a picture:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity. The owner of this web site reserves the right to delete such material.