VB.NET
VB.NET
Example: Socket.AcceptNext method
Demonstrates how to call the AcceptNext method.Chilkat VB.NET Downloads
Dim success As Boolean = False
Dim listenSocket As New Chilkat.Socket
Dim connectedSocket As New Chilkat.Socket
Dim port As Integer = 5555
Dim backlog As Integer = 25
success = listenSocket.BindAndListen(port,backlog)
If (success = False) Then
Debug.WriteLine(listenSocket.LastErrorText)
Exit Sub
End If
' Accept next incoming connection
Dim maxWaitMs As Integer = 200000
success = listenSocket.AcceptNext(maxWaitMs,connectedSocket)
If (success = False) Then
Debug.WriteLine(listenSocket.LastErrorText)
Exit Sub
End If
' ...
' ...
maxWaitMs = 20000
connectedSocket.Close()