public Address localAddress() {return server.localAddress();} public String bindAddress() {return bind_addr;}
public String toString() { return String.format("RouterStub[localsocket=%s, router_host=%s]", client.localAddress(), remote); }
/** * Prints startup information. */ private void printStartupInfo() { System.out.println("GossipRouter started at " + new Date()); System.out.print("Listening on port " + port); System.out.println(" bound on address " + server.localAddress()); System.out.print("Backlog is " + backlog); System.out.print(", linger timeout is " + linger_timeout); System.out.println(", and read timeout is " + sock_read_timeout); }
protected void start(InetAddress bind_addr, int port, boolean nio) throws Exception { server=nio? new NioServer(bind_addr, port) : new TcpServer(bind_addr, port); server.receiver(this); server.start(); JmxConfigurator.register(server, Util.getMBeanServer(), "pub:name=pub-server"); int local_port=server.localAddress() instanceof IpAddress? ((IpAddress)server.localAddress()).getPort(): 0; System.out.printf("\nPubServer listening at %s:%s\n", bind_addr != null? bind_addr : "0.0.0.0", local_port); }
public void start(String ... options) throws Exception { options(options); if(server) { srv=nio? new NioServer(host, port) : new TcpServer(host, port); srv.connExpireTimeout(0); srv.tcpNodelay(false); srv.receiver(this); srv.start(); System.out.printf("server started on %s (ctrl-c to terminate)\n", srv.localAddress()); } else { srv=nio? new NioClient(null, 0, host, port) : new TcpClient(null, 0, host, port); srv.tcpNodelay(false); srv.receiver(this); srv.start(); } }
public Address localAddress() {return server.localAddress();} public String bindAddress() {return bind_addr;}
public String toString() { return String.format("RouterStub[localsocket=%s, router_host=%s]", client.localAddress(), remote); }
/** * Prints startup information. */ private void printStartupInfo() { System.out.println("GossipRouter started at " + new Date()); System.out.print("Listening on port " + port); System.out.println(" bound on address " + server.localAddress()); System.out.print("Backlog is " + backlog); System.out.print(", linger timeout is " + linger_timeout); System.out.println(", and read timeout is " + sock_read_timeout); }
protected void start(InetAddress bind_addr, int port, boolean nio) throws Exception { server=nio? new NioServer(bind_addr, port) : new TcpServer(bind_addr, port); server.receiver(this); server.start(); JmxConfigurator.register(server, Util.getMBeanServer(), "pub:name=pub-server"); int local_port=server.localAddress() instanceof IpAddress? ((IpAddress)server.localAddress()).getPort(): 0; System.out.printf("\nPubServer listening at %s:%s\n", bind_addr != null? bind_addr : "0.0.0.0", local_port); }
public void start(String ... options) throws Exception { options(options); if(server) { srv=nio? new NioServer(host, port) : new TcpServer(host, port); srv.connExpireTimeout(0); srv.tcpNodelay(false); srv.receiver(this); srv.start(); System.out.printf("server started on %s (ctrl-c to terminate)\n", srv.localAddress()); } else { srv=nio? new NioClient(null, 0, host, port) : new TcpClient(null, 0, host, port); srv.tcpNodelay(false); srv.receiver(this); srv.start(); } }