Progress on preventing multiple instances of a program from running in windows

Alex Tweedly alex at tweedly.net
Fri Dec 3 11:28:53 EST 2004


At 10:57 03/12/2004 -0500, Frank D. Engel, Jr. wrote:

>The operating system should prevent two different applications from
>listening on the same port.  Rev shouldn't have to worry about that at
>all.

Indeed - it does. If I start my Python server first, it gets all the 
connection attempts, the Rev server doesn't give an error, but of course 
doesn't get any connections.

>Rev has to go through the same APIs that C programs do (it is, after
>all, written in C/C++, is it not?) so at some level or another, it will
>be blocked from doing that, just as any other program would.
>
>OTOH, if Rev does not generate an error when this happens, it is indeed
>a problem that Rev will need  to deal with.
>
>It *does* generate an error for me, though; check the value of "the
>result" right after the "accept" command.  If the socket does not bind,
>it will be nonempty.  At least, for me it is.

That's what pretty much what I had expected (though I didn't know if it 
would be an error from Accept or an errorSocket) - naturally the docs don't 
say.

That's what I am checking .....

>on startUp
>   accept connections on port "7654" with message "connectionMade"
>   put the result into tResult
>   logWrite "The result from accept is ::" & tResult & "::"
>   send "setMode Server" to me in 100 millisecs
>end startUp

and tResult is empty.


That's on Win2000. What are you running on Frank ?
I'll go try it on XP as well ....

Thanks
-- Alex.


More information about the use-livecode mailing list