equal
deleted
inserted
replaced
729 * <p> |
729 * <p> |
730 * If the socket was connected prior to being {@link #close closed}, |
730 * If the socket was connected prior to being {@link #close closed}, |
731 * then this method will continue to return the connected address |
731 * then this method will continue to return the connected address |
732 * after the socket is closed. |
732 * after the socket is closed. |
733 * |
733 * |
|
734 |
734 * @return a <code>SocketAddress</code> representing the remote endpoint of this |
735 * @return a <code>SocketAddress</code> representing the remote endpoint of this |
735 * socket, or <code>null</code> if it is not connected yet. |
736 * socket, or <code>null</code> if it is not connected yet. |
736 * @see #getInetAddress() |
737 * @see #getInetAddress() |
737 * @see #getPort() |
738 * @see #getPort() |
738 * @see #connect(SocketAddress, int) |
739 * @see #connect(SocketAddress, int) |
845 if (isInputShutdown()) |
846 if (isInputShutdown()) |
846 throw new SocketException("Socket input is shutdown"); |
847 throw new SocketException("Socket input is shutdown"); |
847 final Socket s = this; |
848 final Socket s = this; |
848 InputStream is = null; |
849 InputStream is = null; |
849 try { |
850 try { |
850 is = (InputStream) |
851 is = AccessController.doPrivileged( |
851 AccessController.doPrivileged(new PrivilegedExceptionAction() { |
852 new PrivilegedExceptionAction<InputStream>() { |
852 public Object run() throws IOException { |
853 public InputStream run() throws IOException { |
853 return impl.getInputStream(); |
854 return impl.getInputStream(); |
854 } |
855 } |
855 }); |
856 }); |
856 } catch (java.security.PrivilegedActionException e) { |
857 } catch (java.security.PrivilegedActionException e) { |
857 throw (IOException) e.getException(); |
858 throw (IOException) e.getException(); |
885 if (isOutputShutdown()) |
886 if (isOutputShutdown()) |
886 throw new SocketException("Socket output is shutdown"); |
887 throw new SocketException("Socket output is shutdown"); |
887 final Socket s = this; |
888 final Socket s = this; |
888 OutputStream os = null; |
889 OutputStream os = null; |
889 try { |
890 try { |
890 os = (OutputStream) |
891 os = AccessController.doPrivileged( |
891 AccessController.doPrivileged(new PrivilegedExceptionAction() { |
892 new PrivilegedExceptionAction<OutputStream>() { |
892 public Object run() throws IOException { |
893 public OutputStream run() throws IOException { |
893 return impl.getOutputStream(); |
894 return impl.getOutputStream(); |
894 } |
895 } |
895 }); |
896 }); |
896 } catch (java.security.PrivilegedActionException e) { |
897 } catch (java.security.PrivilegedActionException e) { |
897 throw (IOException) e.getException(); |
898 throw (IOException) e.getException(); |