|
-
Feb 3rd, 2008, 10:53 AM
#11
Re: [RESOLVED] [2008] Can I add a TCPClient Component
 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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|