openstream time out ?

BlitzMax Forums/BlitzMax Programming/openstream time out ?

Paul "Taiphoz"(Posted 2007) [#1]
Just wondering if there is any way to set a time out on this.

For example if I try and open a stream to an IP thats not currently online then at the moment my game code hangs for a while. is there any way to set a time out on this or easy way to trap IP's that are dead. to speed up the programme ?


Brucey(Posted 2007) [#2]
You would need to implement some kind of non-blocking communication. I don't think the built-in modules work in that way.


Winni(Posted 2007) [#3]
That's why you usually use multi-tasking for communication software. ;-)

Anyway, server-side streams in BlitzMax are non-blocking and I never experienced that behaviour there. As for opening a client stream, that's a slightly different story. You usually -want- to know whether the called server is there, won't you?

Since we don't have multi-tasking in BlitzMax, you can put the communication layer in a second process and communicate with that. A lot of effort, and only you can know whether it's worth it.

Next option: Use you OS' socket API directly.

Ok, gotta go.