Commit 179b35a2 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Added getPort() method (JM-623).

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3686 b35dd754-fafc-0310-a699-88a17e54d16e
parent 3c263498
......@@ -49,21 +49,28 @@ public interface Connection {
*/
public InetAddress getInetAddress() throws UnknownHostException;
/**
* Returns the Writer used to send data to the connection. The writer should be
* used with caution. In the majority of cases, the {@link #deliver(Packet)}
* method should be used to send data instead of using the writer directly.
* You must synchronize on the writer before writing data to it to ensure
* data consistency:
*
* <pre>
* Writer writer = connection.getWriter();
* synchronized(writer) {
* // write data....
* }</pre>
*
* @return the Writer for this connection.
*/
/**
* Returns the port that the connection uses.
*
* @return the port that the connection uses.
*/
public int getPort();
/**
* Returns the Writer used to send data to the connection. The writer should be
* used with caution. In the majority of cases, the {@link #deliver(Packet)}
* method should be used to send data instead of using the writer directly.
* You must synchronize on the writer before writing data to it to ensure
* data consistency:
*
* <pre>
* Writer writer = connection.getWriter();
* synchronized(writer) {
* // write data....
* }</pre>
*
* @return the Writer for this connection.
*/
public Writer getWriter();
/**
......@@ -254,7 +261,7 @@ public interface Connection {
* compression is not available. Entities that request a compression negotiation
* will get a stream error and their connections will be closed.
*/
disabled;
disabled
}
/**
......@@ -278,6 +285,6 @@ public interface Connection {
* TLS is not available. Entities that request a TLS negotiation will get a stream
* error and their connections will be closed.
*/
disabled;
disabled
}
}
......@@ -229,6 +229,10 @@ public class SocketConnection implements Connection {
return socket.getInetAddress();
}
public int getPort() {
return socket.getPort();
}
public Writer getWriter() {
return writer;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment