Sample code for 30+ languages & platforms
Xojo Plugin

Example: Socket.AcceptNext method

Demonstrates how to call the AcceptNext method.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

Dim listenSocket As New Chilkat.Socket
Dim connectedSocket As New Chilkat.Socket

Dim port As Int32
port = 5555
Dim backlog As Int32
backlog = 25
success = listenSocket.BindAndListen(port,backlog)
If (success = False) Then
    System.DebugLog(listenSocket.LastErrorText)
    Return
End If

// Accept next incoming connection
Dim maxWaitMs As Int32
maxWaitMs = 200000
success = listenSocket.AcceptNext(maxWaitMs,connectedSocket)
If (success = False) Then
    System.DebugLog(listenSocket.LastErrorText)
    Return
End If

// ...
// ...

maxWaitMs = 20000
success = connectedSocket.Close()