UDP Broadcast (was Re: Program Linking)
Ian Summerfield
iansummerfield at btconnect.com
Wed Mar 20 01:56:01 EST 2002
On 19/3/02 8:08 pm, "Dar Scott" <dsc at swcp.com> scribed:
> Or something like this (ignoring stopping the thing for now for now):
>
> on mouseUp
> accept datagram connections on port 3052 with message "gotGram"
> end mouseUp
>
> on gotGram fromwhom,what
> if what is not empty then
> -- do whatever I want with the data
> close socket 3052
> accept datagram connections on port 3052 with message "gotGram"
> end if
> end gotGram
>
Thanks for that, it works great. A beep shows two datagrams per one sent
(if that makes sense), the first is the garbage one coming from the accept
command. I decided to make it into an OS X fix, so when running under OS 9
it works normally:
on mouseUp
accept datagram connections on port 3052 with message "gotGram"
end mouseUp
on gotGram fromwhom,what
beep
if what is not empty then
-- do whatever I want with the data
if the platform && the systemversion contains "MacOS 10" then
close socket 3052
accept datagram connections on port 3052 with message "gotGram"
end if
end if
end gotGram
More information about the use-livecode
mailing list