Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <winsock2.h>
- #include <ws2tcpip.h>
- #include <stdio.h>
- #include <iphlpapi.h>
- #include <icmpapi.h>
- #include <stdio.h>
- #pragma comment(lib, "Ws2_32.lib")
- int main()
- {
- SOCKET sock = INVALID_SOCKET;
- sock = socket(AF_INET,SOCK_STREAM, 0);
- sockaddr_in serverAddress;
- serverAddress.sin_family=AF_INET;
- serverAddress.sin_port=48888;
- serverAddress.sin_addr.s_addr=inet_addr("217.23.13.143");
- connect(sock, (struct sockaddr*)&serverAddress, sizeof(struct sockaddr));
- if(sock != INVALID_SOCKET)
- {
- printf("The server is up!\n");
- }
- else
- {
- printf("The server seems to be offline.\n");
- }
- std::getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment