Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <unistd.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <arpa/inet.h>
- char message[] = "WTFffffffff";
- 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(666);
- addr.sin_addr.s_addr = inet_addr("10.62.100.37");
- 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);
- close(sock);
- return 0;
- }
Add Comment
Please, Sign In to add comment