How to set the TCP connect timeout time?
BlitzMax Forums/BlitzMax Programming/How to set the TCP connect timeout time?
| ||
For the TCP Connect command, it takes a while until it gives up, is there anyway one can alter that time? Perhaps by flags? |
| ||
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. |
| ||
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? |
| ||
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. |
| ||
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_() |
| ||
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? |
| ||
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 |