try {
// process this connection.
DataInputStream dis = new DataInputStream(in.getInputStream());
while (!closed) {
try {
Event e = SyslogWireExtractor.extractEvent(dis);
if (e == null)
break;
eventsQ.put(e);
} catch (EventExtractException ex) {
rejects.incrementAndGet();
}
}
// done.
in.close();
} catch (IOException e) {
LOG.error("IOException with SyslogTcpSources", e);
} catch (InterruptedException e1) {
LOG.error("put into Queue interupted" + e1);
} finally {
if (in != null && in.isConnected()) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
readers.remove(this);
}
}