title: Other PC can't connect to my server in C
body: <p>I made a Server in C on port 100. The problem is that if anyone out of my PC writes <strong>telnet myip 100</strong> he can't connect to my server!</p>
  
  <p>Code:</p>
  
  <pre><code>#include &lt;io.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;winsock2.h&gt;
  #include &lt;Ws2tcpip.h&gt;
  #include "ws2tcpip.h"
  #pragma comment(lib,"ws2_32.lib")
  
  int main(int argc , char *argv[])
  {
      WSADATA wsa;
      SOCKET s, new_socket;
      struct sockaddr_in server, client;
      int c;
      char *message;
  
      printf("\nInitialising Winsock...\n");
      if (WSAStartup(MAKEWORD(2,2),&amp;wsa) != 0)
      {
          printf("Failed. Error Code : %d",WSAGetLastError());
          return 1;
      }
  
      printf("Winsock initialised.\n");
  
      //Create a socket
      if((s = socket(AF_INET , SOCK_STREAM , 0 )) == INVALID_SOCKET)
      {
          printf("Could not create socket: %d" , WSAGetLastError());
      }
  
      printf("Socket created.\n");
  
      //Prepare the sockaddr_in structure
      server.sin_family = AF_INET;
      server.sin_addr.s_addr = INADDR_ANY;
      server.sin_port = htons(100);
      int inet_pton(int af, const char *src, void *dst);
  
      //Bind
      if( bind(s ,(struct sockaddr *)&amp;server , sizeof(server)) == SOCKET_ERROR)
      {
          printf("Bind failed with error code: %d" , WSAGetLastError());
          exit(EXIT_FAILURE);
      }
  
      puts("Bind done");
  
      //Listen to incoming connections
      listen(s, 3);
  
      //Accept and incoming connection
      puts("Waiting for incoming connections...");
  
      c = sizeof(struct sockaddr_in);
  
      while( (new_socket = accept(s , (struct sockaddr *)&amp;client, &amp;c)) != INVALID_SOCKET )
      {
          puts("Connection accepted");
  
          //Reply to the client
          message = "Hello Client, I have received your connection. But I have to go now... bye!\n";
          send(new_socket, message, strlen(message) , 0);
      }
  
      if (new_socket == INVALID_SOCKET)
      {
          printf("Accept failed with error code: %d" , WSAGetLastError());
          return 1;
      }
  
      closesocket(s);
      WSACleanup();
  
      return 0;
  }
  </code></pre>
  
  <p>My provider is Fastweb (i'm from italy, i don't know if you know it).
  What's the problem? The source code of the server or the provider?</p>
  
  <p>Thank you a lot!</p>