title: How to handle multiple clients on a socket server made with winsock on VB6?
body: <p>i have this very simple chat app made in VB6 using winsock, but as you can see it only accept only one connexion, how can i handle multiple users? Thanks!</p>
  
  <pre><code>Private Sub Winsock1_Close()
      ' Finaliza la conexión
      Winsock1.Close
  
      txtLog = txtLog &amp; "*** Desconectado" &amp; vbCrLf
  
  End Sub
  
  Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
  
      If Winsock1.State &lt;&gt; sckClosed Then
          Winsock1.Close ' close
      End If
  
      Winsock1.Accept requestID
  
      txtLog = "Cliente conectado. IP : " &amp; _
                Winsock1.RemoteHostIP &amp; vbCrLf
  
  End Sub
  
  Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
  Dim dat As String
  
      Winsock1.GetData dat, vbString
      txtLog = txtLog &amp; "Cliente : " &amp; dat &amp; vbCrLf
  
  End Sub
  </code></pre>