rendered paste body// Test2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <winsock.h>
#include <stdio.h>
#include <iostream>
using namespace std;
#pragma comment(lib, "wsock32")
#define DEST_IP "69.33.19.9"
#define DEST_PORT 23 //Telnet
#define MYPORT 3490
int main()
{
int sockfd;
struct sockaddr_in dest_addr; // will hold the destination addr
sockfd = socket(PF_INET, SOCK_STREAM, 0); // do some error checking!
dest_addr.sin_family = AF_INET; // host byte order
dest_addr.sin_port = htons(DEST_PORT); // short, network byte order
dest_addr.sin_addr.s_addr = inet_addr(DEST_IP);
memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
// don't forget to error check the connect()!
connect(sockfd, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr));
cin.get();
}