#include #include #include #include #include char message [] = "Hello, thedddddddddddddddddddddddddddddddddre!\n"; char buf[sizeof(message)]; int main() { int sock; struct sockaddr_in addr; sock = socket(AF_INET, SOCK_STREAM, 0); if (sock < 0) { perror("SOCKET!!!"); exit(1); } addr.sin_family = AF_INET; addr.sin_port = htons (3425); // addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); addr.sin_addr.s_addr = inet_addr("127.0.0.1"); if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { perror("CONNECT!!!"); exit(2); } send(sock, message, sizeof(message), 0); recv(sock, buf, sizeof(message), 0); printf(buf); close(sock); return 0; }