Hi,

I've been trying to search the mailing list, and the documentation,
but I haven't been able to grasp how halt of a server can be
performed.

This is how I setup the server:

private ServiceRegistry registry;
private Service service;
private Address currentAddress;

Server() {
 registry = new SimpleServiceRegistry();
 currentAddress = (Address)addresses.get(currentAddressIndex);
 if (currentAddress.host != null && currentAddress.host.trim().length() > 0) {
   InetSocketAddress socket =
     new InetSocketAddress(currentAddress.host, currentAddress.port);
   service = new Service(getName(), TransportType.SOCKET, socket);
 } else {
   service = new Service(getName(),
   TransportType.SOCKET, currentAddress.port);
 }
}


public void start() throws Exception {
 stopInitiated = false;
 registry.bind(service, DatastructureProtocolHandler.this);
 LOGGER.info("start", "Server " + getName() +
   " bound, listening on port " + currentAddress.port);
}


I would not like to halt the server. That is, the server should reject
new connections, but existing connections/sessions should still be
valid.

How is that done? I would simply stop calling accept if I were using
plain sockets.

Thanks
Kaj

Reply via email to