Question specify timeput for connecting with TCPClient

pooya1072

Well-known member
Joined
Jul 5, 2012
Messages
84
Programming Experience
Beginner
hi
i want to connect to a listener with TCPClient.connect(ip,port) command.but before that i want to specify a timeout for it.
as you know there is 2 command for send and recieve :SendTimeout and RecieveTimeout...but this command is usefull when a connection is created. i want a to specify Timeout for connecting.
 
There's no simple way to do that as far as I know. I think that you'd have to connect asynchronously and use a Timer to Close the TcpClient if a connection is not made within a specific period.
 
Back
Top