1

I have written a program that talks to a Bittorrent tracker via a TCP connection. I want to expand it's functionality to talk to multiple trackers at the same time via winsock in C++.

Do I need to have multiple sockets? If so, do I need to initialize a WSADATA structure for each socket?

4

1 に答える 1

2

You need one socket per TCP connection, i.e. one per remote IP/port pair. You only need to call WSAStartup once to initialize winsock library.

于 2012-07-13T14:54:32.287 に答える