The current namespace implementation was not ideal, it would create a new socket connection for each namespace.
In this PR the namespace was removed from SocketIO class.
To share the same socket connection with multiple namespaces the SocketIONamespace class can be used instead.
Basically SocketIONamespace creates a SocketIO singleton which is reused by all SocketIONamespace instances. SocketIONamespace instances register themselves as a delegate of SocketIO.
SocketIO will send events/messages only to the matching namespace SocketIONamespace instance.
pd: SocketIO has an array of weak pointers for the namespaces delegates implemented with a NSPointerArray, which is available on iOS 6 and later.
The current namespace implementation was not ideal, it would create a new socket connection for each namespace. In this PR the namespace was removed from SocketIO class. To share the same socket connection with multiple namespaces the SocketIONamespace class can be used instead.
Basically SocketIONamespace creates a SocketIO singleton which is reused by all SocketIONamespace instances. SocketIONamespace instances register themselves as a delegate of SocketIO. SocketIO will send events/messages only to the matching namespace SocketIONamespace instance.
pd: SocketIO has an array of weak pointers for the namespaces delegates implemented with a NSPointerArray, which is available on iOS 6 and later.