Just a way to shorten the method

{
 bool disconnect = false;
 if (connectedSocket > 0)
 {
    disconnect = tcpClient->TCP_Disconnect(connectedSocket);
    if(disconnect)
    {
       connectedSocket = -1;
    }
  }
  return disconnect;
}