specifies the maximum number of connection requests that can be pending for this process listen: establish the connection with a specific client accept: equivalents of read and write (repeated) send, recv: end reading or writing shutdown: release kernel data structures close: Client performs the following actions create the socket socket: connect to a server connect: (repeated) send, recv: shutdown close sockets Dept of ISE, CIT, Gubbi Page no45 Networks Lab 2015-16 socket API #include<sys/types.h> #include<sys /socket.h> int socket(int domain, int type, int protocol) ; Returns a file descriptor (called a socket ID) if successful, -1 otherwise. Note that the socket returns a socket descriptor which is the same as a file descriptor. The is AF_INET. domain The argument can be: type SOCK_STREAM: Establishes a virtual circuit for stream SOCK_DGRAM: Establishes a datagram for communication SOCK_SEQPACKET: Establishes a reliable, connection based, two way communication with maximum message size. (This is not available on most machines.) is usually zero, so that type defines the connection within domain. protocol bind #include <sys / types.h> #include<sys / socket.h>
listen: specifies the maximum number of connection requests that can be pending for this process accept: establish the connection with a specific client send, recv: equivalents of read and write (repeated) shutdown: end reading or writing close: release kernel data structures Client performs the following actions socket: create the socket connect: connect to a server send, recv: (repeated) shutdown close sockets Dept of ISE, CIT, Gubbi Page no45 Networks Lab 2015-16 socket API #include<sys/types.h> #include<sys /socket.h> int socket(int domain, int type, int protocol) ; Returns a file descriptor (called a socket ID) if successful, -1 otherwise. Note that the socket returns a socket descriptor which is the same as a file descriptor. The domain is AF_INET. The type argument can be: SOCK_STREAM: Establishes a virtual circuit for stream SOCK_DGRAM: Establishes a datagram for communication SOCK_SEQPACKET: Establishes a reliable, connection based, two way communication with maximum message size. (This is not available on most machines.) protocol is usually zero, so that type defines the connection within domain. bind #include <sys / types.h> #include<sys / socket.h>