'This part is in another procedure
Select Case Left(strData, 20)
Case CM_QUERY_HOSTINFO
strSendData = CM_QUERY_HOSTINFO
Call SendData_sckTCP(SocketIndex, strSendData)
MsgBox frmMainCommon.sckTCP(SocketIndex).State
If IntVar.Flag_IsServer = True Then
strSendData = CM_INFO_SERVERINFO & HostInfo_Local.B_UCDHostname
Call SendData_sckTCP(SocketIndex, strSendData)
Else
strSendData = CM_INFO_LOCALINFO & HostInfo_Local.B_UCDHostname
Call SendData_sckTCP(SocketIndex, strSendData)
End If
'This the generic send procedure
Public Sub SendData_sckTCP(SocketIndex As Integer, strSendData As String)
'Procedure Description:
'
Dim Counter_SendAttempts As Byte
Dim strIPAddress_tmp As String
Counter_SendAttempts = 0
strIPAddress_tmp = ""
On Error GoTo Error_Handler 'Enable error handler
frmMainCommon.sckTCP(SocketIndex).SendData strSendData
On Error GoTo 0 'Disable error handler
Exit Sub 'Exit function on successful send.
Error_Handler:
Counter_SendAttempts = Counter_SendAttempts + 1
If Counter_SendAttempts = MaxRetry_Send Then
strIPAddress_tmp = IndexToIP_HostInfo_Array(SocketIndex)
MsgBox "Unable to send data to remotehost " & Trim(strIPAddress_tmp) & "." _
& vbCrLf & vbCrLf _
& "sckTCP(" & SocketIndex & ") will be unloaded and the corresponding" _
& vbCrLf & "host information will be removed from:" & vbCrLf _
& " HostInfo_Array()" & vbCrLf _
& " LoadedsckTCP_Array()", _
vbOKOnly, "Error: SendData_sckTCP(" & SocketIndex & ")"
Call UnassignIndex_sckTCP(SocketIndex)
Call RemoveFrom_HostInfo_Array(strIPAddress_tmp)
Resume Next
Else
Resume 'Retry send.
End If
'Procedure Analysis:
End Sub