added send and recv
This commit is contained in:
@@ -54,6 +54,7 @@ int main(int argc, char* argv[]) {
|
||||
char *remote_machine, *local_port, *remote_port;
|
||||
int status, socketfd, confd, len;
|
||||
int yes = 1;
|
||||
char *buf;
|
||||
|
||||
if (argc != 4) {
|
||||
printf("Wrong number of arguments. Usage: ./chatty <local port> \
|
||||
@@ -168,6 +169,9 @@ int main(int argc, char* argv[]) {
|
||||
servinfo = q;
|
||||
}
|
||||
printf("Connected!\n");
|
||||
|
||||
recv(socketfd, &buf, 20, 0);
|
||||
printf("%s\n", buf);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user