[e-lang] Redirectories and captp://
list at waterken.net
Tue Sep 14 11:28:42 EDT 2004
I'm making progress on integrating VatTP with SSL and redirectories, but
have come upon another (in a long series) of hurdles. I've got a
solution, but it's an ugly one (also in a long series), so I was
wondering if anyone here knows of anything better.
A Vat on a dynamic IP address must update its redirectory when the IP
address changes. The problem is detecting this change. I was hoping that
java.net.ServerSocket would throw an exception when the bound address
becomes invalid, but that doesn't seem to happen. Here's the test code I
System.out.println("Determining local address...");
InetAddress address = InetAddress.getLocalHost();
System.out.println("Localhost is: " + address);
ServerSocket socket = new ServerSocket(80, 50, address);
Socket incoming = socket.accept();
System.out.println("Socket accept error: " + e);
System.out.println("Socket open error: " + e);
When I release my DHCP lease, the program continues to sit on the
java.net.ServerSocket.accept() invocation, waiting for connections it
cannot possibly receive.
The call to java.net.InetAddress.getLocalHost() does reflect changes in
the host IP address. So it would seem the only solution is to poll the
host IP address. Yuck.
Does anyone know of any other API options? If not, any suggestions on
how the polling should be implemented?
The web-calculus is the union of REST and capability-based security.
More information about the e-lang