Skip to content

Commit

Permalink
Expose the socket's local port in IMAPProtocol/Protocol - fix #356
Browse files Browse the repository at this point in the history
  • Loading branch information
bshannon committed Mar 23, 2019
1 parent 7ca5b33 commit b523a87
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/release/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ longer available.
The following bugs have been fixed in the 1.6.4 release.

E 350 ServiceLoader loads default providers ahead of application providers
E 356 Expose the socket's local port in IMAPProtocol/Protocol
E 361 Support the NTLMv2 authentication protocol
E 363 Multipart message sent with headers but no body
E 366 NPE when recipients not set
Expand Down
13 changes: 12 additions & 1 deletion mail/src/main/java/com/sun/mail/iap/Protocol.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -553,6 +553,17 @@ public SocketChannel getChannel() {
return ret;
}

/**
* Return the local SocketAddress (host and port) for this
* end of the connection.
*
* @return the SocketAddress
* @since JavaMail 1.6.4
*/
public SocketAddress getLocalSocketAddress() {
return socket.getLocalSocketAddress();
}

/**
* Does the server support UTF-8?
* This implementation returns false.
Expand Down

0 comments on commit b523a87

Please sign in to comment.