trigger transport event upon its creation
This commit is contained in:
@@ -255,13 +255,18 @@ public class Socket extends Emitter {
|
||||
opts.policyPort = this.policyPort;
|
||||
opts.socket = this;
|
||||
|
||||
Transport transport;
|
||||
if (WebSocket.NAME.equals(name)) {
|
||||
return new WebSocket(opts);
|
||||
transport = new WebSocket(opts);
|
||||
} else if (Polling.NAME.equals(name)) {
|
||||
return new PollingXHR(opts);
|
||||
transport = new PollingXHR(opts);
|
||||
} else {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
throw new RuntimeException();
|
||||
this.emit(EVENT_TRANSPORT, transport);
|
||||
|
||||
return transport;
|
||||
}
|
||||
|
||||
private void setTransport(Transport transport) {
|
||||
@@ -275,8 +280,6 @@ public class Socket extends Emitter {
|
||||
|
||||
this.transport = transport;
|
||||
|
||||
self.emit(EVENT_TRANSPORT, transport);
|
||||
|
||||
transport.on(Transport.EVENT_DRAIN, new Listener() {
|
||||
@Override
|
||||
public void call(Object... args) {
|
||||
|
||||
Reference in New Issue
Block a user