DelphiFAQ Home Search:
General :: Programming
This category is about general programming issues. Documents dealing with issues specific to a certain programming language or development environment are in the categories below.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

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

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'.