Microtome/websocket-serial-server

Seperate open/close port from subscription?

DanielJoyce opened this issue · 0 comments

Currently when you open a port opened by someone else, you are really subscribing to said port

When you close a port, the underlying serial port is not closed till all other clients close that port as well. Its more like unsubscription.

Should we seperate the two?

  1. Client who opens port gets write-lock to port
  2. Client which subscribes to port gets all read events
  3. Client with writelock can close port
    1. All other clients would be notified of closure
  4. unsubscribe does not close port, leaves port open but releases write locks
  5. other clients can then write lock port to get read/close control of it
  6. client dropping off does not close port either