Explain the bind function in socket programming?
freddik 26-October-2007 05:14:45 PM

Comments


address usually set to INADDR_ANY – chooses a local address
Posted by waqasahmad


int status = bind(sockid, &addrport, size);
status: error status, = -1 if bind failed
sockid: integer, socket descriptor
addrport: struct sockaddr, the (IP) address and port of the machine (address usually set to INADDR_ANY – chooses a local address)
size: the size (in bytes) of the addrport structure
bind can be skipped for both types of sockets.

Posted by Fangzhou



Posted: 26-October-2007 05:38:41 PM By: Fangzhou

int status = bind(sockid, &addrport, size);
status: error status, = -1 if bind failed
sockid: integer, socket descriptor
addrport: struct sockaddr, the (IP) address and port of the machine (address usually set to INADDR_ANY – chooses a local address)
size: the size (in bytes) of the addrport structure
bind can be skipped for both types of sockets.

Posted: 31-December-2008 12:24:56 AM By: waqasahmad

address usually set to INADDR_ANY – chooses a local address