Code example for ServerSocket

Methods: getInetAddress, getLocalPort

0
 
		ServerSocket listener = iface.socket();
		assert (listener != null) : "TCPConvergenceLayer : dump_interface, socket is null";
 
		String text = String.format("\tlocal_addr: %s local_port: %s\n",
				listener.getInetAddress(), listener.getLocalPort());
		buf.append(text);
 
	} 
	 
	/** 
	 * Parse the destination  IPaddress and the remote port 
	 */ 
	public boolean parse_nexthop (Link link, LinkParams lparams){
		 
		TCPLinkParams params = (TCPLinkParams)(lparams);
	    assert(params != null);
	    
	     
	    params.remote_addr_ = link.dest_ip();
	    params.remote_port_ = link.remote_port();