Hi!
A strange error happens in my app.
Here is the initial code:
The if is always true, but perror prints: "socket: No Error".Code:#include <iostream> #include <winsock.h> #include <stdlib.h> #include <errno.h> using namespace std; #define PORT 6000 int main(int argc, char** argv){ int server, client; struct sockaddr_in local; struct sockaddr_in remote; server = socket(AF_INET, SOCK_STREAM, 0); if( server == -1 ){ perror("socket"); exit(1); } // the rest of the code is not included }
What is the problem?
Thanks any help or pointer to solution!



LinkBack URL
About LinkBacks


