public final class EngineIoSocket extends Emitter
Modifier and Type | Class and Description |
---|---|
static interface |
EngineIoSocket.SocketedListener |
Emitter.Listener
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this socket.
|
Emitter |
emit(String event,
Object... args)
Executes each of listeners with the given args.
|
String |
getId()
Gets the sid of this socket.
|
Map<String,List<String>> |
getInitialHeaders()
Get the headers of the initial HTTP connection.
|
Map<String,String> |
getInitialQuery()
Get the query parameters of the initial HTTP connection.
|
int |
getProtocolVersion()
Gets the protocol version of this socket.
|
ReadyState |
getReadyState()
Gets the ready state of this socket.
|
EngineIoSocket |
off(String event)
Removes all listeners of the specified event.
|
EngineIoSocket |
off(String event,
EngineIoSocket.SocketedListener fn)
Removes the listener.
|
EngineIoSocket |
on(String event,
EngineIoSocket.SocketedListener fn)
Listen on the event.
|
void |
send(Packet<?> packet)
Send a packet to the remote client.
|
public String getId()
public int getProtocolVersion()
public ReadyState getReadyState()
public Map<String,String> getInitialQuery()
public Map<String,List<String>> getInitialHeaders()
public void send(Packet<?> packet)
packet
- The packet to send.public void close()
public EngineIoSocket on(String event, EngineIoSocket.SocketedListener fn)
event
- Event namefn
- Event listenerpublic EngineIoSocket off(String event, EngineIoSocket.SocketedListener fn)
event
- an event name.fn
- Event listener.public EngineIoSocket off(String event)
Emitter
Copyright © 2022. All rights reserved.