How to set the TCP connect timeout time?

BlitzMax Forums/BlitzMax Programming/How to set the TCP connect timeout time?

Tibit(Posted 2006) [#1]
For the TCP Connect command, it takes a while until it gives up, is there anyway one can alter that time? Perhaps by flags?


FlameDuck(Posted 2006) [#2]
Generally speaking, no. It's determined dynamicly by the TCP protocol. There may be some way to overrie it, but I wouldn't recommend it.

A better solution would be non-blocking calls.


Tibit(Posted 2006) [#3]
A better solution would be non-blocking calls

How do I do that? Please explain more, or link me. Can it be done in BlitzMax?


FlameDuck(Posted 2006) [#4]
Can it be done in BlitzMax?
I dunno, I haven't really looked at BlitzMAX's socket implementation. Probably not until we get multithreading tho'.

Depending on how you're using it, you can kind fake it with UDP tho'. Ofcourse then there's the problem of NAT traversal.


deps(Posted 2006) [#5]
Don't know if you got this link, but here's how to use non-blocking calls in C. http://beej.us/guide/bgnet/output/html/advanced.html#select

No multithreading needed.


Edit:

Select can be found in Pub.StdC as select_()


Tibit(Posted 2006) [#6]
deps, I think you are refering to non-blocking receiving of TCP. That I have working, it is when TCP connects that it needs to do it's hand-shake thing and until it gives up or succeeds 200-?ms something, everything freezes. Or did I miss something myself, did you refer to connect?

With UDP I'm already faking it (Atleast I think I do what you mean by that). UDP is Soooo simple compared to TCP.

What NAT traversal problem? Is it something I have missed here?


deps(Posted 2006) [#7]
Not sure what I was thinking. But after some googling it looks like I was at least a bit right. :)
http://www.manualy.sk/sock-faq/unix-socket-faq-3.html#ss3.5