Information Technology Reference
In-Depth Information
(Index As Integer, ByVal requestID As Long)
If Index = 0 Then
ConnectNo = ConnectNo + 1
Load multServer(ConnectNo)
multServer(ConnectNo).LocalPort = 0
multServer(ConnectNo).Accept requestID
Load txtData(ConnectNo)
End If
End Sub
24.10.4 Connect event
The Connect event connects to a server. If an error occurs then a flag (ErrorOccurred) is set
to True, else it is False. Its syntax is
Private Sub object . Connect(ErrorOccurred As Boolean)
24.10.5 Close event
The Close event occurs when the remote computer closes the connection. Applications
should use the Close method to correctly close their connection. Its syntax is
object _ Close()
24.10.6
DataArrival event
The DataArrival event occurs when new data arrives, and returns the number of bytes read
(bytesTotal). Its syntax is
object _ DataArrival (bytesTotal As Long)
24.10.7 Bind method
The Bind method specifies the local port (LocalPort) and the local IP address (LocalIP) to be
used for TCP connections. Its syntax is
object . Bind LocalPort , LocalIP
24.10.8 Listen method
The Listen method creates a socket and goes into listen mode (for server applications). Its
stays in this mode until a ConnectionRequest event occurs, which indicates an incoming con-
nection. After this, the Accept method should be used to accept the connection. Its syntax is:
object . Listen
24.10.9 Accept method
The Accept method accepts incoming connections after a ConnectionRequest event. Its syn-
tax is
object . Accept requestID
The requestID parameter is passed into the ConnectionRequest event and is used with the
Search WWH ::




Custom Search