an example client server application once the address is obtained it can be sent back to the client in python it is necessary to decode(and encoded(the string format to the raw data transmitted via the socket streams note you should always close socket when you have finished with it socket types and domains when we created the socket class abovewe passed in two arguments to the socket constructorsocket(socket af_inetsocket sock_streamto understand the two values passed into the socket(constructor it is necessary to understand that sockets are characterised according to two propertiestheir domain and their type the domain of socket essentially defines the communications protocols that are used to transfer the data from one process to another it also incorporates how sockets are named (so that they can be referred to when establishing the communicationtwo standard domains are available on unix systemsthese are af_unix which represents intra-system communicationswhere data is moved from process to process through kernel memory buffers af_inet represents communication using the tcp/ip protocol suitein which processes may be on the same machine or on different machines socket' type indicates how the data is transferred through the socket there are essentially two options heredatagram which sockets support message-based model where no connection is involvedand communication is not guaranteed to be reliable stream sockets that support virtual circuit modelwhere data is exchanged as byte stream and the connection is reliable depending on the domainfurther socket types may be availablesuch as those that support message passing on reliable connection implementing the client application the client application is essentially very simple program that creates link to the server application to do this it creates socket object that connects to the servershost machineand in our case this socket is connected to port once connection has been made the client can then send the encoded message string to the server the server will then send back response which the client must decode it then closes the connection