diff options
Diffstat (limited to 'programs/tsctp.c')
-rw-r--r-- | programs/tsctp.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/programs/tsctp.c b/programs/tsctp.c index 8068c1ad..d7c23e40 100644 --- a/programs/tsctp.c +++ b/programs/tsctp.c @@ -127,9 +127,8 @@ handle_connection(void *arg) { ssize_t n; char *buf; -#ifdef _WIN32 - HANDLE tid; -#else + +#if !defined(_WIN32) pthread_t tid; #endif struct socket *conn_sock; @@ -151,9 +150,8 @@ handle_connection(void *arg) unsigned long long sum = 0; conn_sock = *(struct socket **)arg; -#ifdef _WIN32 - tid = GetCurrentThread(); -#else + +#if !defined(_WIN32) tid = pthread_self(); pthread_detach(tid); #endif @@ -349,7 +347,6 @@ int main(int argc, char **argv) unsigned long messages = 0; #ifdef _WIN32 unsigned long srcAddr; - HANDLE tid; #else in_addr_t srcAddr; pthread_t tid; @@ -648,19 +645,19 @@ int main(int argc, char **argv) continue; } #ifdef _WIN32 - tid = CreateThread(NULL, 0, &handle_connection, (void *)conn_sock, 0, NULL); + CreateThread(NULL, 0, &handle_connection, (void *)conn_sock, 0, NULL); #else pthread_create(&tid, NULL, &handle_connection, (void *)conn_sock); #endif } if (verbose) { - // const char *inet_ntop(int af, const void *src, char *dst, socklen_t size) - //inet_ntoa(remote_addr.sin_addr) + /* const char *inet_ntop(int af, const void *src, char *dst, socklen_t size) + inet_ntoa(remote_addr.sin_addr) */ char addrbuf[INET_ADDRSTRLEN]; printf("Connection accepted from %s:%d\n", inet_ntop(AF_INET, &(remote_addr.sin_addr), addrbuf, INET_ADDRSTRLEN), ntohs(remote_addr.sin_port)); } } - //usrsctp_close(psock); // unreachable + /* usrsctp_close(psock); unreachable */ } else { memset(&encaps, 0, sizeof(struct sctp_udpencaps)); encaps.sue_address.ss_family = AF_INET; |