Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <windows.h>
- #include <winsock2.h>
- #define PORT 9002
- void wait_key();
- int main (int argc, char *argv[]) {
- WSADATA wsa;
- WSAStartup(0x22, &wsa);
- SOCKET listen_sock = INVALID_SOCKET;
- listen_sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- SOCKADDR_IN sock_addr = {
- .sin_family = AF_INET,
- .sin_addr.s_addr = inet_addr("127.0.0.1"),
- .sin_port = htons(PORT)
- };
- bind(listen_sock, (SOCKADDR *)&sock_addr, sizeof(sock_addr));
- listen(listen_sock, SOMAXCONN);
- printf("AAA\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement