Mercurial > vba-clojure
comparison src/gba/remote.cpp @ 21:e0545ef33bb9
trying to fix network problem
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 04 Mar 2012 16:56:20 -0600 |
parents | ecd30c5e2f5a |
children | 8870086b716c |
comparison
equal
deleted
inserted
replaced
20:ecd30c5e2f5a | 21:e0545ef33bb9 |
---|---|
119 if (listen(s, 1)) | 119 if (listen(s, 1)) |
120 { | 120 { |
121 fprintf(stderr, "Error listening\n"); | 121 fprintf(stderr, "Error listening\n"); |
122 exit(-1); | 122 exit(-1); |
123 } | 123 } |
124 socklen_t len = sizeof(addr); | 124 |
125 | 125 |
126 #ifdef WIN32 | 126 #ifdef WIN32 |
127 int flag = 0; | 127 int flag = 0; |
128 ioctlsocket(s, FIONBIO, (unsigned long *)&flag); | 128 ioctlsocket(s, FIONBIO, (unsigned long *)&flag); |
129 #endif // WIN32 | 129 #endif // WIN32 |
130 | |
131 socklen_t len = sizeof(addr); | |
132 | |
130 int s2 = accept(s, (sockaddr *)&addr, &len); | 133 int s2 = accept(s, (sockaddr *)&addr, &len); |
131 if (s2 > 0) | 134 if (s2 > 0) |
132 { | 135 { |
133 fprintf(stderr, "Got a connection from %s %d\n", | 136 fprintf(stderr, "Got a connection from %s %d\n", |
134 inet_ntoa((in_addr)addr.sin_addr), | 137 inet_ntoa((in_addr)addr.sin_addr), |