Reputation: 578
In https://docs.python.org/2/library/socket.html, the socket.bind(address) entry says:
Bind the socket to address. The socket must not already be bound. (The format of address depends on the address family — see above.)
That is all it says, what does "Bind the socket to address" mean?
Upvotes: 5
Views: 6925
Reputation: 1905
It's basically just assigning an address to it so you can accept incoming connections on that address. Have a look at: man bind
Upvotes: 3
Reputation: 39414
It just means that after also calling listen()
and when using the accept()
method, it will be listening for requests to connect to that particular address.
Upvotes: 1