daltoniam / Starscream

Websockets in swift for iOS and OSX
Apache License 2.0
8.3k stars 1.2k forks source link

How do i connect to & manage multiple namespaces ? #317

Closed arvryna closed 7 years ago

arvryna commented 7 years ago

I would like to do the following.

//Establish socket connection with server var parentSocket = Create a socket connection to a URL : http://myapp.com

//Create multiple namespaces and manage their life cycle (associated with parent connection) like mentioned below var ns1 = parentSocket.createNameSpace('/ns1') emit and recieve ping/pongs in ns1 recieve message in ns1 close ns1 when needed

--

  1. Ideally i want to have only one socket connection and multiple namespaces from that.
  2. Is there any reactive extensions written on top of this library. ? Please share if any.

CC: @nuclearace

Thanks in advance.

acmacalister commented 7 years ago
  1. This is a base RFC 6455 conforming WebSocket library and since the spec doesn't have the notation of namespaces, neither does this library. That would be something you would need to build on top of this library. I assume from you referencing @nuclearace you are using the Socket.io client, which has the concept of namespaces. https://github.com/socketio/socket.io-client-swift

  2. Yes, I think so. That being said, we don't maintain any of them, so I can't speak to any of them. I would suggest search Github and using your favorite.

arvryna commented 7 years ago

@acmacalister : Thanks man 👍