Where is the socket id sid: is a pointer to the address family dependent address structure addrPtr: is the size of *addrPtr len: Associates a socket id with an address to which other processes can connect. In internet protocol the address is [ipNumber, portNumber] sockaddr For the internet family: struct sockaddr_in { sa_family_t sin_family; // = AF INET in_port_t sin_port; // is a port number struct in_addr sin_addr; // an IP address } Dept of ISE, CIT, Page no46 Networks Lab 2015-16 listen #include <sys / #include <sys / socket.h> int listen (int sid, int size) ; Where size it the number of pending connection requests allowed (typically limited by Unix kernels to 5). Returns the 0 on success, or -1 if failure. accept #include <sys / types.h> #include <sys / socket.h> int accept(int sid ,struct sockaddr *addrPtr , int *lenPtr ) Returns the socketId and address of client connecting to socket. if lenPtr or addrPtr equal zero, no address structure is returned. lenPtr is the maximum size of address structure that can be called, returns the actual value.
Where sid: is the socket id addrPtr: is a pointer to the address family dependent address structure len: is the size of *addrPtr Associates a socket id with an address to which other processes can connect. In internet protocol the address is [ipNumber, portNumber] sockaddr For the internet family: struct sockaddr_in { sa_family_t sin_family; // = AF INET in_port_t sin_port; // is a port number struct in_addr sin_addr; // an IP address } Dept of ISE, CIT, Page no46 Networks Lab 2015-16 listen #include <sys / #include <sys / socket.h> int listen (int sid, int size) ; Where size it the number of pending connection requests allowed (typically limited by Unix kernels to 5). Returns the 0 on success, or -1 if failure. accept #include <sys / types.h> #include <sys / socket.h> int accept(int sid ,struct sockaddr *addrPtr , int *lenPtr ) Returns the socketId and address of client connecting to socket. if lenPtr or addrPtr equal zero, no address structure is returned. lenPtr is the maximum size of address structure that can be called, returns the actual value.
ISE-VINAY-NET.docx