java.lang.Object
io.helidon.common.socket.PlainSocket
- All Implemented Interfaces:
- HelidonSocket,- SocketContext,- Supplier<byte[]>
- Direct Known Subclasses:
- TlsSocket
Helidon socket that is based on plaintext.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedPlainSocket(Socket delegate, String childSocketId, String socketId) Plain socket.
- 
Method SummaryModifier and TypeMethodDescriptionChild socket id.static PlainSocketCreate a new client socket.voidclose()Close the underlying socket.byte[]get()voididle()Sets the socket to idle mode.booleanCheck if socket is connected.booleanisSecure()Whether the request is secure.Local peer information.intread(BufferData buffer) Read bytes from the socket.Remote peer information.static PlainSocketCreate a new server socket.socketId()Main socket id.voidwrite(BufferData buffer) Write teh buffer to the underlying socket.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.common.socket.HelidonSocketprotocol, protocolNegotiatedMethods inherited from interface io.helidon.common.socket.SocketContextlog, log
- 
Constructor Details- 
PlainSocketPlain socket.- Parameters:
- delegate- delegate socket
- childSocketId- channel id
- socketId- server channel id
 
 
- 
- 
Method Details- 
serverCreate a new server socket.- Parameters:
- delegate- underlying socket
- channelId- channel id
- serverChannelId- server channel id
- Returns:
- a new plain socket
 
- 
clientCreate a new client socket.- Parameters:
- delegate- underlying socket
- channelId- channel id
- Returns:
- a new plain socket
 
- 
remotePeerDescription copied from interface:SocketContextRemote peer information.- Specified by:
- remotePeerin interface- SocketContext
- Returns:
- peer info
 
- 
localPeerDescription copied from interface:SocketContextLocal peer information.- Specified by:
- localPeerin interface- SocketContext
- Returns:
- peer info
 
- 
isSecurepublic boolean isSecure()Description copied from interface:SocketContextWhether the request is secure.- Specified by:
- isSecurein interface- SocketContext
- Returns:
- whether secure
 
- 
socketIdDescription copied from interface:SocketContextMain socket id. This is the server socket id for server side, connection id for client side.- Specified by:
- socketIdin interface- SocketContext
- Returns:
- socket id
 
- 
childSocketIdDescription copied from interface:SocketContextChild socket id. This is the connection socket id for server side. For client side, this may be additional identification of a request (pipeline id, stream id).- Specified by:
- childSocketIdin interface- SocketContext
- Returns:
- child socket id, never null
 
- 
closepublic void close()Description copied from interface:HelidonSocketClose the underlying socket.- Specified by:
- closein interface- HelidonSocket
 
- 
idlepublic void idle()Description copied from interface:HelidonSocketSets the socket to idle mode. Idle mode expects no bytes coming over the socket but keeps reading exactly one byte in case connection is severed. Idle mode should be used in case of client side connection caching.- Specified by:
- idlein interface- HelidonSocket
 
- 
isConnectedpublic boolean isConnected()Description copied from interface:HelidonSocketCheck if socket is connected.- Specified by:
- isConnectedin interface- HelidonSocket
- Returns:
- true if connected
 
- 
readDescription copied from interface:HelidonSocketRead bytes from the socket. This method blocks until at least 1 byte is available.- Specified by:
- readin interface- HelidonSocket
- Parameters:
- buffer- buffer to read to
- Returns:
- number of bytes read
 
- 
writeDescription copied from interface:HelidonSocketWrite teh buffer to the underlying socket. This method blocks until all bytes are written.- Specified by:
- writein interface- HelidonSocket
- Parameters:
- buffer- buffer to write
 
- 
getpublic byte[] get()
 
-