sockets in python setting up connection to set up the connectionone process must be running program that is waiting for connection while the other must try to connect up to the first program the first is referred to as server socket while the second just as socket for the second process to connect to the first (the server socketit must know what machine the first is running on and which port it is connected to for examplein the above diagram the server socket connects to port in turn the client socket connects to the machine on which the server is executing and to port number on that machine nothing happens until the server socket accepts the connection at that point the sockets are connectedand the socket streams are bound to each other this means that the server' output stream is connected to the client socket input stream and vice versa an example client server application the system structure the above diagram illustrates the basic structure of the system we are trying to build there will be server object running on one machine and client object running on another the client will connect up to the server using sockets in order to obtain information the actual application being implemented in this exampleis an address book look up application the addresses of employees of company are held in dictionary this dictionary is set up in the server program but could equally be held in database etc when client connects up to the server it can obtain an employeesoffice address