Skip to main content
 首页 » 编程设计

python之套接字绑定(bind)是什么意思

2024年11月01日12zengkefu

在https://docs.python.org/2/library/socket.html , socket.bind(address) 条目说:

Bind the socket to address. The socket must not already be bound. (The format of address depends on the address family — see above.)

这就是它所说的,“将套接字绑定(bind)到地址”是什么意思?

请您参考如下方法:

它基本上只是为它分配一个地址,这样您就可以接受该地址上的传入连接。看看:man bind