   Could someone look at this?  O_o
  I was just wondering if there's anything wrong in this...#include <winsock2.h>#include <iostream>using namespace std;int main(){   int err;    WORD wVersionRequested;    WSADATA wsaData;   wVersionRequested = MAKEWORD(2, 2);   err = WSAStartup(wVersionRequested, &wsaData);   if (err != 0)    {  cout << "WSASTARTUP ERROR: Initialization failed";  }    SOCKADDR_IN HostAddress;    int hostPortID = 5150;   HostAddress.sin_family = AF_INET;    HostAddress.sin_port = hostPortID;    HostAddress.sin_addr.s_addr = inet_addr("136.149.3.29");    HostAddress.sin_port = htons(INADDR_ANY);   SOCKET s;    SOCKADDR_IN tcpSocket;    int portID;   s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);   bind(s, (SOCKADDR *) &tcpSocket, sizeof(tcpSocket);   listen(s, 5);    }The reason I ask is because if I go to cmd.exe and type netstat -aon, I don't see anything listed.   
  You have no application loop, so the app closes right after "listen(s, 5);".  You need a while loop to process incoming connections; in something like this, i would highly suggest you do it on a separate thread.-Nate S.   ;Original post by OneThreeThreeSeven    SOCKADDR_IN HostAddress;    int hostPortID = 5150;    HostAddress.sin_family = AF_INET;    HostAddress.sin_port = hostPortID; // hostPortID should be in network byte order, use htons(hostPortID) instead.    HostAddress.sin_addr.s_addr = inet_addr("136.149.3.29");    HostAddress.sin_port = htons(INADDR_ANY); // What is this line supposed to do? :)I put some comments into your code. You are setting sin_port twice and the latter assign does not really make any sense. Also, you might want set sin_addr to INADDR_ANY, if you are not sure about your IP address or it is not static.Edit: Is that really _the_ code you are using? It shouldn't even compile because of missing parenthesis in the line you call bind.;HostAddress.sin_port = htons(INADDR_ANY);What you meant was probably the following:HostAddress.sin_addr.s_addr = htonl(INADDR_ANY);Note that I changed sin_port to sin_addr.s_addr, and htons to htonl. htons() means host to network short, which swaps the byte order of a 16-bit integer. However, s_addr (aka S_un.S_addr) is a 32-bit integer, and should thus be passed through htonl(), or host to network long. However, since INADDR_ANY typically evaluates to 0, swapping it has no effect.You should always check the return values of the Winsock functions. If they fail, they return a value lower than zero, so to test for failure you do something along the lines of:if(somewinsockcall() < 0){    std::cout << "somewinsockcall() failed with code " << WSAGetLastError() << std::endl;};  This may help you get started.Getting started in WinsockGood luck :)   