user2738698
user2738698

Reputation: 578

What does socket binding mean?

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

Answers (2)

agrinh
agrinh

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

quamrana
quamrana

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

Related Questions