Private MyRoomServer As String, MySourceID As String
Public Sub StartService(ByVal VoiceServer As String, ByVal VoicePort As String)
On Error Resume Next
Winsock1.Close
Winsock2.Close
Winsock1.Protocol = sckTCPProtocol
Winsock2.Protocol = sckTCPProtocol
Winsock2.RemoteHost = VoiceServer
Winsock1.LocalPort = VoicePort
Winsock1.Listen
End Sub
Public Sub StopService()
On Error Resume Next
Winsock1.Close
Winsock2.Close
End Sub
Private Sub UserControl_Initialize()
On Error Resume Next
Set Winsock1 = New Winsock
Set Winsock2 = New Winsock
End Sub
Private Sub UserControl_Resize()
On Error Resume Next
UserControl.Width = 420
UserControl.Height = 420
End Sub
Private Sub UserControl_Terminate()
On Error Resume Next
Set Winsock1 = Nothing
Set Winsock2 = Nothing
End Sub
Private Sub Winsock1_Close()
On Error Resume Next
Winsock1.Close
Winsock2.Close
Form1.YTCP1.StopService
Winsock1.Listen
End Sub
Private Sub Winsock2_Close()
On Error Resume Next
Winsock1.Close
Winsock2.Close
Form1.YTCP1.StopService
Winsock1.Listen
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
On Error Resume Next
Winsock2.Close
Winsock2.RemotePort = Winsock1.LocalPort
Winsock2.Connect
Do
DoEvents
Loop Until Winsock2.State = sckConnected
Winsock1.Close
Winsock1.Accept requestID
End Sub
Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
On Error Resume Next
Winsock1.Close
Winsock2.Close
End Sub
Private Sub Winsock2_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
On Error Resume Next
Winsock1.Close
Winsock2.Close
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
On Error Resume Next
Dim Data As String, DataLength As Integer, TmpData As String, HeaderLength As Integer