0

Ok, i've been tyring to get this to work for days, and I got it down to this, but it still all doesnt work. Any advice as to what I may be doing wrong would be greatly appreciated.

Function Listen(ByVal backlog As Integer)
        lsocket.Listen(backlog)
        If Not lsocket.Connected Then
            Console.WriteLine("Winsock error: " + Convert.ToString(System.Runtime.InteropServices.Marshal.GetLastWin32Error()))
        End If
    End Function
    Public Sub tmrlisten_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrlisten.Tick
        txtchatwindow.Text = txtchatwindow.Text + vbNewLine + "Listening..."
        If lsocket.Connected Then
            tmrlisten.Enabled = False
        End If
    End Sub
    Public Sub btnListen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnListen.Click
        Dim endpoint As New IPEndPoint(IPAddress.Any, 0)
        Try
            lsocket.Bind(endpoint)
        Catch ex As Exception
            Console.WriteLine("Winsock error: " + ex.ToString)
        End Try
        Listen(10)
        tmrlisten.Enabled = True
    End Sub
3
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by Lord Soth
0

You r tring to write a GUI programming but using Console output .

Please change the Console.**** to something else in GUI

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.