October 1st, 2004, 12:11 PM
problems with sockets.
for long time i am trying to setup in 1 word (timeout) .. its seems i cant do it..
i started to built simple socket that connect to some host on some port and what i wanted is just to set timeout for it.. that sockets(tidtcpclinet) like are bloing the therad so i want it will blook for about 500ms only i mean after 0.5 the socket will be over, so i tyred with timer after i built the timer object i figure out that timer not working in his own thread, so the socket bloked him 2 ( the timer just waits 0.5sec the disconnected the sock) so my qustion is how ppl eastblishing time out i mean, letting the sock to think for (limted time).
i dont use other thread to do it so its takes more memory.
i allso tried waitfordata(time) seems not to work.
i have heard about nonblocking socket(i just need to connect to some pc on some port)
so what soltion does anybody know socket with working timeout ?
socket.waitfordata(5000) // 5 sec
socket.connect / try to connect.