nt flag) ; // "socID" is the socket on which send or receive needs to be disabled. // "flag" is used to set the type of operation to be disabled. 10. Connect: This function is used by the client to connect to a server that is listening for connection. #include <sys/types.h> #include <sys/socket.h> int connect (int SOCID, struct sockaddr *addrPtr, int addrlen) i // "socID" is the id of the socket. // "addrPtr" is a pointer to the address family. // "addrlen" is the size of socket address. 11. close: This function is used to close connection corresponding to the socket descriptor and free the socket descriptor. #include <sys/types.h> #include <sys/socket.h> int close (int sockID) // "socID" is the id of the socket to be closed. It can be called by both the client and the server. Fundamentals of EMS, NMS and OSS/BSS 26.7 Client Server Implementation for Connection Oriented Communication The following activities are performed by the client and server in connection ori- ented communication (see also Figure 26.5): Server creates a server socket. Server binds with the socket. Server listens for connection requests from client. Client creates a client socket. Client sends a connection request to server. Server accepts the request from client and connection is established between the client and server. Client and server exchange (send and receive) messages. Client closes the socket connection with server. Server can wait for connection request for another client or close the server socket. The server can use only one well-known port at a time for communication, but there are several client connections open at the same time that requires the pres- ence of several ports. To overcome this problem the server issues several ephemeral ports along with the well-known port. The connection made to the well-known Server Client Socket Socket Listen Connect Accept Receive Receive Close Close Figure 26.5 Connection oriented communication. Socket Communication port is assigned to the temporary port SO that the data transfer takes place