Reputation: 22906
Socket names are strings and appear in the file system name space through portals.
The bind call is used to assign a name to a socket on the local side of a connection.
from http://osr507doc.sco.com/en/netguide/dusockD.binding_names.html
int bind(int socket, const struct sockaddr *address, socklen_t address_len);
from the man page of bind.
What EXACTLY are the socket "names"? And do we "set" them?
The bind system call, doesn't seem to have an argument for specifying a name, does it?
Upvotes: 2
Views: 3528
Reputation: 1019
It's common that the function which acturally opens the socket returns a handle/identifier(socket descriptor) for future references.
As the link you posted describes:
bind(s, name, namelen);
The argument s in the line above is the socket descriptor returned from the socket() call.
I think it's just a custom name for the socket descriptor
, and therefore optional. Probably also depends on what you're about to do, if you need it.
Upvotes: 1