After doing a Google search and being unsatisfied with the results, I figured I'd come here to ask this question.
I'm new to Socket Programming in C++. Basically, I'm making a very basic Client application that talks to a server and listens for a response. Is it possible to create multiple sockets in a program, one socket that actually talks to a server and the other that receives its response?
If so, would the following block of code be needed each time I initialize a new socket, or can it just be initialized once in the program?
Question
Viserov
After doing a Google search and being unsatisfied with the results, I figured I'd come here to ask this question.
I'm new to Socket Programming in C++. Basically, I'm making a very basic Client application that talks to a server and listens for a response. Is it possible to create multiple sockets in a program, one socket that actually talks to a server and the other that receives its response?
If so, would the following block of code be needed each time I initialize a new socket, or can it just be initialized once in the program?
WSADATA WsaData; if( WSAStartup( MAKEWORD( 1, 1 ), &WsaData ) != 0 ) { printf( "Error!"); exit( 0 ); }Remember, I'm quite new to this! Thanks :)
Link to comment
Share on other sites
6 answers to this question
Recommended Posts