diff --git a/amf.c b/amf.c index 870a768..6fae3ba 100644 --- a/amf.c +++ b/amf.c @@ -21,11 +21,11 @@ for (i = 0;i < 1536;i++) { data2[i] = (char)i; } - if (send(fd,&cmd,1,0) != 1) { + if (send(fd,&cmd,1,MSG_NOSIGNAL) != 1) { printf("Error Sending Header\n"); return(-1); } - if (send(fd,&data2,1536,0) != 1536) { + if (send(fd,&data2,1536,MSG_NOSIGNAL) != 1536) { printf("Error Sending Hand2\n"); return(-1); } @@ -37,6 +37,7 @@ printf("Error getting handshake\n"); return(-1); } + printf("Got all data!\n"); return(0x0); } diff --git a/socket.c b/socket.c index 1201f75..b167aac 100644 --- a/socket.c +++ b/socket.c @@ -29,7 +29,7 @@ struct sockaddr_in myAddr; // my address information - if ((listenerFD = socket(PF_INET, SOCK_STREAM, 0)) == -1) { + if ((listenerFD = socket(AF_INET, SOCK_STREAM, 0)) == -1) { perror("socket"); exit(1); } @@ -39,8 +39,7 @@ exit(1); } - - myAddr.sin_family = PF_INET; // host byte order + myAddr.sin_family = AF_INET; // host byte order myAddr.sin_port = htons(MYPORT); // short, network byte order myAddr.sin_addr.s_addr = INADDR_ANY; // automatically fill with my IP memset(myAddr.sin_zero, '\0', sizeof myAddr.sin_zero);