/* Make the necessary includes and set up the variables. */ #include #include #include #include #include #include #include int main() { int sockfd; int len; struct sockaddr_in address; int result; char ch[1024]; /* Create a socket for the client. */ sockfd = socket(AF_INET, SOCK_STREAM, 0); /* Name the socket, as agreed with the server. */ address.sin_family = AF_INET; address.sin_addr.s_addr = inet_addr("192.168.1.88"); address.sin_port = 7311; len = sizeof(address); /* Now connect our socket to the server's socket. */ result = connect(sockfd, (struct sockaddr *)&address, len); if(result == -1) { perror("oops: Connect to server failed"); exit(1); } /* We can now read/write via sockfd. */ strcpy(ch, "program:Marote\1call:K6EEP\1mhz:28.058\1mode:SSB\1rx:456\1name:Mike\1"); len = sizeof ch; write(sockfd, &ch, len); close(sockfd); exit(0); }