Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们的服务器上有N 个本地 IP。我需要使用其中之一创建套接字连接。我怎样才能做到这一点 ?
fd = socket(AF_INET, SOCK_STREAM, 0); connect(fd, (struct sockaddr*)addr, sizeof(*addr)); // ...
bind()在连接之前将套接字连接到适当的本地地址。
bind()