Package io.socket.engineio.server
Class Transport
java.lang.Object
io.socket.engineio.server.Emitter
io.socket.engineio.server.Transport
Base class for all transports.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.socket.engineio.server.Emitter
Emitter.Listener -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the transport if not already closed.protected abstract voiddoClose()Transport specific logic for closing transport.Get the headers of the initial HTTP request.Get the query parameters of the initial HTTP request.abstract StringgetName()Get the name of this transport.abstract booleanChecks whether the transport is currently writable.protected voidonClose()Called by child to indicate closure of transport.protected voidCalled by child to indicate data received from remote client.protected voidCalled by child class to indicate error with transport.protected voidCalled 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 a list of packets over the transport.
-
Field Details
-
mParser
-
mReadyState
-
-
Constructor Details
-
Transport
-
-
Method Details
-
getInitialQuery
Get the query parameters of the initial HTTP request.- Returns:
- Query parameters of the initial HTTP request.
-
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 IOException Handle a client HTTP request.- Parameters:
request- The HTTP request object.response- The HTTP response object.- Throws:
IOException- On IO error.
-
send
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
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
Called by child class to indicate error with transport.- Parameters:
reason- Reason of error.description- Description of error.
-
onPacket
Called by child to indicate a packet receive from remote client.- Parameters:
packet- Packet received by transport.
-
onData
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.
-