From: hackbard Date: Wed, 16 Oct 2002 17:49:36 +0000 (+0000) Subject: corrected versions X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=d85aa3d936d20cc0a7f34cb79ee558328a925af7;p=my-code%2Fivac.git corrected versions --- diff --git a/stream.c b/stream.c index 1d4990d..0991611 100644 --- a/stream.c +++ b/stream.c @@ -39,9 +39,10 @@ int main(int argc, char *argv[]) { } local_addr.sin_family=AF_INET; - local_addr.sin_port=htons(atoi(argv[1])); + // local_addr.sin_port=htons(atoi(argv[1])); + local_addr.sin_port=htons(1025); local_addr.sin_addr.s_addr=htonl(INADDR_ANY); - memset(&(local_addr.sin_zero),'\0',8); + memset((void *)&(local_addr.sin_zero),'\0',8); if(bind(listen_fd,&local_addr,sizeof(struct sockaddr))==-1) { printf("unable to bind on port %d.\n",atoi(argv[1])); @@ -55,7 +56,7 @@ int main(int argc, char *argv[]) { } if(send_fd=accept(listen_fd,(struct sockaddr *)remote_addr, - sizeof(struct sockaddr_in))!=1) { + sizeof(struct sockaddr_in))!=-1) { printf("accepting connection from %s port %d.\n", inet_ntoa(remote_addr->sin_addr), ntohs(remote_addr->sin_port));