From: David ‘Bombe’ Roden Date: Fri, 26 Apr 2013 05:13:07 +0000 (+0200) Subject: Add methods to close the connection. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=202d800ae7fa28b80ee047bed157e08a8afcc4f9;p=xudocci.git Add methods to close the connection. --- diff --git a/src/main/java/net/pterodactylus/irc/Connection.java b/src/main/java/net/pterodactylus/irc/Connection.java index 530b0c7..ac29809 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -278,6 +278,16 @@ public class Connection extends AbstractExecutionThreadService implements Servic connectionHandler.sendCommand("PRIVMSG", recipient, String.format("\u0001DCC RESUME %s %d %d\u0001", filename, port, position)); } + /** + * Closes this connection. + * + * @throws IOException + * if an I/O error occurs + */ + public void close() throws IOException { + connectionHandler.close(); + } + // // ABSTRACTEXECUTIONTHREADSERVICE METHODS // diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index d89f807..5b883db 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -249,6 +249,20 @@ public class Core extends AbstractExecutionThreadService { } } + /** + * Closes the given connection. + * + * @param connection + * The connection to close + */ + public void closeConnection(Connection connection) { + try { + connection.close(); + } catch (IOException ioe1) { + /* TODO */ + } + } + // // ABSTRACTIDLESERVICE METHODS //