Class NettyTransportServer
- java.lang.Object
-
- org.apache.hugegraph.computer.core.network.netty.NettyTransportServer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,TransportServer
public class NettyTransportServer extends java.lang.Object implements TransportServer, java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description NettyTransportServer()NettyTransportServer(io.netty.buffer.ByteBufAllocator bufAllocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.InetSocketAddressbindAddress()Get the bindInetSocketAddressbooleanbound()To check whether the server is bound to use.voidclose()TransportConfconf()java.lang.Stringip()Get the bind IPintlisten(org.apache.hugegraph.computer.core.config.Config config, MessageHandler serverHandler)Startup server, return the port listened.intport()Get the bind portvoidshutdown()Stop the server.
-
-
-
Method Detail
-
listen
public int listen(org.apache.hugegraph.computer.core.config.Config config, MessageHandler serverHandler)Description copied from interface:TransportServerStartup server, return the port listened.- Specified by:
listenin interfaceTransportServer
-
conf
public TransportConf conf()
-
port
public int port()
Description copied from interface:TransportServerGet the bind port- Specified by:
portin interfaceTransportServer
-
ip
public java.lang.String ip()
Description copied from interface:TransportServerGet the bind IP- Specified by:
ipin interfaceTransportServer
-
bindAddress
public java.net.InetSocketAddress bindAddress()
Description copied from interface:TransportServerGet the bindInetSocketAddress- Specified by:
bindAddressin interfaceTransportServer
-
shutdown
public void shutdown()
Description copied from interface:TransportServerStop the server.- Specified by:
shutdownin interfaceTransportServer
-
bound
public boolean bound()
Description copied from interface:TransportServerTo check whether the server is bound to use.- Specified by:
boundin interfaceTransportServer- Returns:
- true if server is bound.
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-