use of com.alipay.remoting.RemotingServer in project hugegraph-common by hugegraph.
the class RpcServer method port.
public int port() {
this.checkEnabled();
Server server = this.serverConfig.getServer();
if (server instanceof BoltServer && server.isStarted()) {
/*
* When using random port 0, try to fetch the actual port
* NOTE: RemotingServer.port() would return the actual port only
* if sofa-bolt version >= 1.6.1, please see:
* https://github.com/sofastack/sofa-bolt/issues/196
* TODO: remove this code after adding Server.port() interface:
* https://github.com/sofastack/sofa-rpc/issues/1022
*/
RemotingServer rs = Whitebox.getInternalState(server, "remotingServer");
return rs.port();
}
// When using random port 0, the returned port is not the actual port
return this.serverConfig.getPort();
}
use of com.alipay.remoting.RemotingServer in project sofa-rpc by sofastack.
the class BoltServer method initRemotingServer.
protected RemotingServer initRemotingServer() {
// 绑定到端口
RemotingServer remotingServer = new RpcServer(serverConfig.getBoundHost(), serverConfig.getPort());
remotingServer.registerUserProcessor(boltServerProcessor);
return remotingServer;
}
Aggregations