title: WinError: 10054 (0x2746) An existing connection was forcibly closed by the remote host. TCP Server
body: <p>I have the client side in C# running from Unity and it's just this</p>
  <pre><code>byte[] buffer = { 1 };
  Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
  s.Connect(IP, PORT);
  System.Int32 Result = s.Send(buffer);
  Debug.Log(Result);
  </code></pre>
  <p>and the server side is written in C, it's really long so here is the place where I get the error</p>
  <pre><code>for(char i = 0; i &lt; MAX_PLAYERS; ++i)
  {
              if(ClientSockets[i] == INVALID_SOCKET) break;
              
  
              Result = recv(ClientSockets[i], Message, sizeof(Message), 0);
              
              if (Result == SOCKET_ERROR)
              {
                  unsigned long LastError = GetLastError();
                  if (LastError != 10035)
                  {
                      Error(&quot;recv failed.\n&quot;);
                  }
              }
  </code></pre>
  <p>I've made the socket's non blocking with <code>ioctlsocket(ClientSocket, FIONBIO, &amp;iMode)</code> before putting them in the ClientSockets array.</p>