yrashk/socket.io-erlang — Issue #71: Can't use two event handlers for two different ports from the same socketio application
Author: pauloros
Created: 2012-03-07 20:32:48+00:00
State: open

I have a case where I'm expecting two classes of clients to connect to the same socketio application and they would each have their own different messages.

I'm trying to implement this using two different default_http_handlers but socketio_listener:start is giving me the same PID even if I specify different ports in different calls. Subsequently the socketio_listener:event_manager is obviously the same, so if I can't attach different handlers to the two different ports.

From the console:
```erlang

application:start (misultin).
application:start (socketio).

{ok, Pid1} = socketio_listener:start([{http_port, 8485}, {default_http_handler,h1}]).
{ok, Pid2} = socketio_listener:start([{http_port, 8486}, {default_http_handler,h2}]).

Pid1 == Pid2.
true
```

Is there a workaround or a better way to achieve this?