Fully operational prototype plugin. Fixed RX issues

This commit is contained in:
Joseph Henry
2016-06-20 16:21:28 -07:00
parent a2a939f6f6
commit a7aa5c28c0
9 changed files with 72 additions and 43 deletions

View File

@@ -13,7 +13,7 @@ int main(int argc , char *argv[])
return 1;
}
int sock, port = atoi(argv[1]);
int sock, port = atoi(argv[2]);
struct sockaddr_in server;
char message[1000] , server_reply[2000];
@@ -40,11 +40,15 @@ int main(int argc , char *argv[])
scanf("%s" , message);
//Send some data
if(send(sock , message , strlen(message) , 0) < 0)
if(send(sock , "welcome to the machine!" ,24 , 0) < 0)
{
puts("Send failed");
return 1;
}
else
{
printf("len = %d\n", strlen(message));
}
//Receive a reply from the server
if(recv(sock , server_reply , 2000 , 0) < 0)