VBBeginner
Programmer
Help me Please!
I tried to build up a small chat using the Winsock control, but my programm didnt work like it should have done. I give you the source-code, so that someone should be able to help me. The main Problem is: It is not giving me any Runtime-Error or anything like this, its just not working.
Server programm:
I am using TCPProtocol for this.
I have a Textfield named: txtsend and one named txtoutput
my frame is called frmserver the winsock control is called tcpServer i have the following source code included:
Private Sub Form_Load()
tcpServer.LocalPort = 1001
tcpServer.Listen
frmClient.Show
End Sub
Private Sub tcpServer_ConnectionRequest _
(ByVal requestID As Long)
If tcpServer.State <> sckClosed Then _
tcpServer.Close
tcpServer.Accept requestID
End Sub
Private Sub txtSendData_Change()
tcpServer.SendData txtSendData.Text
End Sub
Private Sub tcpServer_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
tcpServer.GetData strData
txtOutput.Text = strData
End Sub
This is all for the server programm.
The client programm:
I have a Textfield named: txtsend and one named txtoutput
my frame is called frmclient the winsock control is called tcpclient and there is a command button called cmdconnect, i have the following source code included:
Private Sub Form_Load()
tcpClient.RemoteHost = "RemoteComputerName"
tcpClient.RemotePort = 1001
End Sub
Private Sub cmdConnect_Click()
tcpClient.Connect
End Sub
Private Sub txtSendData_Change()
tcpClient.SendData txtSend.Text
End Sub
Private Sub tcpClient_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
tcpClient.GetData strData
txtOutput.Text = strData
End Sub
Most irritating for me is: This programm is original from the MSN Library!!!!!!!!! And it doesnt work!!!!!
I dont know what to do, please help me.
I tried to build up a small chat using the Winsock control, but my programm didnt work like it should have done. I give you the source-code, so that someone should be able to help me. The main Problem is: It is not giving me any Runtime-Error or anything like this, its just not working.
Server programm:
I am using TCPProtocol for this.
I have a Textfield named: txtsend and one named txtoutput
my frame is called frmserver the winsock control is called tcpServer i have the following source code included:
Private Sub Form_Load()
tcpServer.LocalPort = 1001
tcpServer.Listen
frmClient.Show
End Sub
Private Sub tcpServer_ConnectionRequest _
(ByVal requestID As Long)
If tcpServer.State <> sckClosed Then _
tcpServer.Close
tcpServer.Accept requestID
End Sub
Private Sub txtSendData_Change()
tcpServer.SendData txtSendData.Text
End Sub
Private Sub tcpServer_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
tcpServer.GetData strData
txtOutput.Text = strData
End Sub
This is all for the server programm.
The client programm:
I have a Textfield named: txtsend and one named txtoutput
my frame is called frmclient the winsock control is called tcpclient and there is a command button called cmdconnect, i have the following source code included:
Private Sub Form_Load()
tcpClient.RemoteHost = "RemoteComputerName"
tcpClient.RemotePort = 1001
End Sub
Private Sub cmdConnect_Click()
tcpClient.Connect
End Sub
Private Sub txtSendData_Change()
tcpClient.SendData txtSend.Text
End Sub
Private Sub tcpClient_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
tcpClient.GetData strData
txtOutput.Text = strData
End Sub
Most irritating for me is: This programm is original from the MSN Library!!!!!!!!! And it doesnt work!!!!!
I dont know what to do, please help me.