OpenSockets and multiple stacks...?

Sarah Reichelt sarah.reichelt at gmail.com
Tue Oct 25 18:30:47 EDT 2005


> Not sure if this is possible, but I'd like to be able to have a single stack, let's call it the instructors stack, send out a text message to multiple stacks all within a single classroom network all at one time. The "multiple stacks" would be student stacks.
>
>
> I have had a look at some of the sample stacks in the "User Spaces" specifically the work that AlexTweedly has done with his "TCP and UDP" stacks, but have yet to determine if sockets would work in a implementation as i have described. I get the impression that sockets is something that can only occur between two stacks, not between one and many, or many to many.
>
> Or, do sockets allow you to open multiple sockets in order to facilitate mutliple connections to a single server stack?
>
> What I would like to get to is a Revolution based system similar to a classroom performance system (http://www.pearsonncs.com/cps/) but utilizing laptops and the improved capabilities of Revolution.
>

I can't remember the exact details, but I seem to recall that you can
broadcast a message over a UDP port by using IP address
255.255.255.255

Choose a certain port number (50000 in my examples) and on the
instructor's computer open a socket to that port:
  open socket to "255.255.255.255:50000"
Send data out that port:
  write "Hello there" to socket "255.255.255.255:50000"

Have the student computers listen on that port number:
  accept datagram connections on port 50000 with message doMessage

The doMessage handler can get the received data and process it.

Dar Scott had a UDP stack that demonstrated this better than I can explain it.

Cheers,
Sarah



More information about the use-livecode mailing list