mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kaj Bjurman" <kaj.bjur...@gmail.com>
Subject Halt?
Date Fri, 09 Jun 2006 08:48:06 GMT

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

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

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


View raw message