Package io.socket.engineio.server
Class Transport
- java.lang.Object
-
- io.socket.engineio.server.Emitter
-
- io.socket.engineio.server.Transport
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.socket.engineio.server.Emitter
Emitter.Listener
-
-
Field Summary
Fields Modifier and Type Field Description protected ParsermParserprotected ReadyStatemReadyState
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()Close the transport if not already closed.protected abstract voiddoClose()Transport specific logic for closing transport.abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>>getInitialHeaders()Get the headers of the initial HTTP request.abstract java.util.Map<java.lang.String,java.lang.String>getInitialQuery()Get the query parameters of the initial HTTP request.abstract java.lang.StringgetName()Get the name of this transport.abstract booleanisWritable()Checks whether the transport is currently writable.protected voidonClose()Called by child to indicate closure of transport.protected voidonData(java.lang.Object data)Called by child to indicate data received from remote client.protected voidonError(java.lang.String reason, java.lang.String description)Called by child class to indicate error with transport.protected voidonPacket(Packet<?> packet)Called by child to indicate a packet receive from remote client.abstract voidonRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)Handle a client HTTP request.abstract voidsend(java.util.List<Packet<?>> packets)Send a list of packets over the transport.
-
-
-
Field Detail
-
mParser
protected final Parser mParser
-
mReadyState
protected ReadyState mReadyState
-
-
Constructor Detail
-
Transport
protected Transport(Parser parser)
-
-
Method Detail
-
getInitialQuery
public abstract java.util.Map<java.lang.String,java.lang.String> getInitialQuery()
Get the query parameters of the initial HTTP request.- Returns:
- Query parameters of the initial HTTP request.
-
getInitialHeaders
public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getInitialHeaders()
Get the headers of the initial HTTP request.- Returns:
- Headers of the initial HTTP request.
-
onRequest
public abstract void onRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws java.io.IOExceptionHandle a client HTTP request.- Parameters:
request- The HTTP request object.response- The HTTP response object.- Throws:
java.io.IOException- On IO error.
-
send
public abstract void send(java.util.List<Packet<?>> packets)
Send a list of packets over the transport.- Parameters:
packets- List of packets to send.
-
isWritable
public abstract boolean isWritable()
Checks whether the transport is currently writable.- Returns:
- Boolean value indicating if transport can be written to.
-
getName
public abstract java.lang.String getName()
Get the name of this transport.- Returns:
- Name of transport.
-
doClose
protected abstract void doClose()
Transport specific logic for closing transport.
-
close
public void close()
Close the transport if not already closed.
-
onError
protected void onError(java.lang.String reason, java.lang.String description)Called by child class to indicate error with transport.- Parameters:
reason- Reason of error.description- Description of error.
-
onPacket
protected void onPacket(Packet<?> packet)
Called by child to indicate a packet receive from remote client.- Parameters:
packet- Packet received by transport.
-
onData
protected void onData(java.lang.Object data)
Called by child to indicate data received from remote client.- Parameters:
data- Encoded data received by transport.
-
onClose
protected void onClose()
Called by child to indicate closure of transport.
-
-