/** * Binds to the specified port on the specified addr. Note that this addr must represent a local * IP address. **** How bind to INADDR_ANY? **** * * @param addr the address to bind to * @param port the port number to bind to * @throws IOException if an error occurs */ protected synchronized void bind(InetAddress addr, int port) throws IOException { if (channel == null) create(true); impl.bind(new InetSocketAddress(addr, port)); localport = channel.getVMChannel().getLocalAddress().getPort(); }