java.lang.Object
io.helidon.common.socket.NioSocket
io.helidon.common.socket.TlsNioSocket
- All Implemented Interfaces:
HelidonSocket,SocketContext,Supplier<byte[]>
TLS NIO helidon socket.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TlsNioSocketclient(SocketChannel delegate, SSLEngine sslEngine, String channelId) Create a client TLS NIO socket.voidclose()Close the underlying socket.byte[]get()booleanisSecure()Whether the request is secure.Local peer information.protocol()Protocol that was negotiated.booleanWhether a protocol was negotiated by the socket (such as ALPN when using TLS).intread(BufferData buffer) Read bytes from the socket.Remote peer information.static TlsNioSocketserver(SocketChannel delegate, SSLEngine sslEngine, String channelId, String serverChannelId) Create a server TLS NIO socket.voidwrite(BufferData buffer) Write teh buffer to the underlying socket.Methods inherited from class io.helidon.common.socket.NioSocket
childSocketId, client, idle, isConnected, read, server, socketId, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.common.socket.SocketContext
log, log
-
Method Details
-
server
public static TlsNioSocket server(SocketChannel delegate, SSLEngine sslEngine, String channelId, String serverChannelId) Create a server TLS NIO socket.- Parameters:
delegate- underlying socketsslEngine- SSL enginechannelId- listener channel idserverChannelId- connection channel id- Returns:
- a new TLS socket
-
client
Create a client TLS NIO socket.- Parameters:
delegate- underlying socketsslEngine- SSL enginechannelId- channel id- Returns:
- a new TLS socket
-
remotePeer
Description copied from interface:SocketContextRemote peer information.- Specified by:
remotePeerin interfaceSocketContext- Overrides:
remotePeerin classNioSocket- Returns:
- peer info
-
localPeer
Description copied from interface:SocketContextLocal peer information.- Specified by:
localPeerin interfaceSocketContext- Overrides:
localPeerin classNioSocket- Returns:
- peer info
-
isSecure
public boolean isSecure()Description copied from interface:SocketContextWhether the request is secure.- Specified by:
isSecurein interfaceSocketContext- Overrides:
isSecurein classNioSocket- Returns:
- whether secure
-
protocolNegotiated
public boolean protocolNegotiated()Description copied from interface:HelidonSocketWhether a protocol was negotiated by the socket (such as ALPN when using TLS).- Returns:
- whether a protocol was negotiated
-
protocol
Description copied from interface:HelidonSocketProtocol that was negotiated.- Returns:
- protocol name
-
get
public byte[] get() -
read
Description copied from interface:HelidonSocketRead bytes from the socket. This method blocks until at least 1 byte is available.- Specified by:
readin interfaceHelidonSocket- Overrides:
readin classNioSocket- Parameters:
buffer- buffer to read to- Returns:
- number of bytes read
-
write
Description copied from interface:HelidonSocketWrite teh buffer to the underlying socket. This method blocks until all bytes are written.- Specified by:
writein interfaceHelidonSocket- Overrides:
writein classNioSocket- Parameters:
buffer- buffer to write
-
close
public void close()Description copied from interface:HelidonSocketClose the underlying socket.- Specified by:
closein interfaceHelidonSocket- Overrides:
closein classNioSocket
-