What's wrong with my chat program code(Visual Basic)?

Demetris

New member
I'm trying to write a chat program in visual basic 2008 using winsock. When ever i use this it always gets stuck at Winsock.GetData(messagein) and does nothing. Could somebody tell me where my code has errors please.
Localhost is set to 255.255.255.255
local port and remote port are the same
and protocal is set to 1
Any help would be appreciated.
Thanks in advance.

Public Class Form1
Dim messagein As String
Dim messageout As String
Private Sub sendButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sendButton.Click
messageout = sendTextBox.Text
Winsock.SendData(messageout)
End Sub

Private Sub Winsock_DataArrival(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles Winsock.DataArrival
Winsock.GetData(messagein)
getTextBox.Text = messagein
End Sub

End Class
 
Back
Top