Results 1 to 2 of 2

Thread: Websockets Question

  1. #1
    Join Date
    Oct 2012

    Question Websockets Question

    Let's presume that you would like your webserver clients to get "push" notifications of Girder system
    changes or events, and you want to use websockets to provide this function.

    From experimentation with the example websocket server and connection scheme, it seems that only one client can be
    connected to a websocket server path at a time (there is not a one-to-many connection ability). Therefore, if
    you want two or more clients to be updated through websocket connections that are pushed from the server,
    you would need to first register one websocket server and path for the first client, and after that client
    connects, you would have to register another websocket server and path (a different path) for the next client
    that wants to connect. Then you could loop through a table of websocket objects and push data
    to each of them.

    My question is:
    How do you manage websocket servers? There doesn't seem to be a way to "un" register a websocket server,
    other than re-starting the lua engine. It seems like it would be a waste of resources for the webserver
    to be always "listening" for websocket server path connections that have been disconnected and are no
    longer needed. Am I missing something?

  2. #2
    Join Date
    Oct 2012


    Oops! It looks like I was missing something.

    I noticed in the variable inspector that there is a webserver object method called "unregisterWebSocketServer". Clearly this is how they are managed.
    I can't seem to find documentation that explains how to use this method. Can anyone help?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts