Quote Originally Posted by kaisellgren
This isn't working

Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Try
            listener = New System.Net.Sockets.TcpListener(System.Net.IPAddress.Any, 43001) 'The TcpListener will listen for incoming connections at port 43001        
            listener.Start() 'Start listening.
            listenThread = New System.Threading.Thread(AddressOf DoListen) 'This thread will run the doListen method        
            listenThread.IsBackground = True 'Since we dont want this thread to keep on running after the application closes, we set isBackground to true.        
            listenThread.Start() 'Start executing doListen on the worker thread.   
        Catch ex As Exception
            Timer1.Enabled = False
            Timer1.Interval = 5000
            Timer1.Enabled = True
            Exit Sub
        End Try
    End Sub
I have the same code in initial button press.
How come?