Searched refs:socket (Results 1 - 25 of 59) sorted by relevance

123

/libcore/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/
H A DOpenSSLSocketImplWrapper.java27 * This class wraps the SSL functionality over an existing connected socket.
31 private Socket socket; field in class:OpenSSLSocketImplWrapper
33 protected OpenSSLSocketImplWrapper(Socket socket, String host, int port, argument
35 super(socket, host, port, autoClose, sslParameters);
36 if (!socket.isConnected()) {
39 this.socket = socket;
45 throw new IOException("Underlying socket is already connected.");
50 throw new IOException("Underlying socket is already connected.");
55 throw new IOException("Underlying socket i
[all...]
H A DSSLSocketWrapper.java28 * This class wraps the SSL fuctionality over existing conneted socket.
32 private final Socket socket; field in class:SSLSocketWrapper
35 protected SSLSocketWrapper(Socket socket, String host, int port, boolean autoClose, argument
38 if (!socket.isConnected()) {
41 this.socket = socket;
48 input = socket.getInputStream();
49 output = socket.getOutputStream();
55 socket.close();
66 throw new IOException("Underlying socket i
[all...]
H A DOpenSSLSocketImpl.java79 private final Socket socket; field in class:OpenSSLSocketImpl
98 * getSoTimeout to delegate to the wrapped socket.
108 this.socket = this;
115 this.socket = this;
122 this.socket = this;
129 this.socket = this;
138 this.socket = this;
146 this.socket = this;
151 * Create an SSL socket that wraps another socket
154 OpenSSLSocketImpl(Socket socket, String host, int port, boolean autoClose, SSLParametersImpl sslParameters) argument
[all...]
/libcore/dalvik/src/main/java/dalvik/system/
H A DSocketTagger.java24 * Callbacks for socket assignment and reassignment.
37 * thread. The socket is either newly connected or reused from a connection
47 * <p><strong>Note:</strong> this method will not be invoked when the socket
52 public final void tag(Socket socket) throws SocketException { argument
53 if (!socket.isClosed()) {
54 tag(socket.getFileDescriptor$());
58 public final void untag(Socket socket) throws SocketException { argument
59 if (!socket.isClosed()) {
60 untag(socket.getFileDescriptor$());
65 * Sets this process' socket tagge
[all...]
/libcore/luni/src/main/java/java/nio/
H A DServerSocketChannelImpl.java41 private final ServerSocketAdapter socket; field in class:ServerSocketChannelImpl
50 this.socket = new ServerSocketAdapter(this);
51 this.impl = socket.getImpl$();
54 @Override public ServerSocket socket() { method in class:ServerSocketChannelImpl
55 return socket;
66 // Create an empty socket channel. This will be populated by ServerSocketAdapter.accept.
75 socket.implAccept(result);
86 end(result.socket().isConnected());
88 return result.socket().isConnected() ? result : null;
98 if (!socket
[all...]
H A DSocketChannelImpl.java72 private SocketAdapter socket = null; field in class:SocketChannelImpl
82 // Whether the socket is bound.
90 * Constructor for creating a connected socket channel.
97 * Constructor for creating an optionally connected socket channel.
102 fd = (connect ? IoBridge.socket(true) : new FileDescriptor());
115 * Getting the internal Socket If we have not the socket, we create a new
119 synchronized public Socket socket() { method in class:SocketChannelImpl
120 if (socket == null) {
128 socket = new SocketAdapter(new PlainSocketImpl(fd, localPort, addr, port), this);
133 return socket;
[all...]
/libcore/luni/src/test/java/libcore/java/net/
H A DOldAndroidDatagramTest.java40 DatagramSocket socket; field in class:OldAndroidDatagramTest.Reflector
57 socket.receive(packet);
72 socket.send(packet);
79 socket.close();
89 socket = new DatagramSocket(port, address);
119 DatagramSocket socket = null;
129 socket = new DatagramSocket(2345, InetAddress.getLocalHost());
139 socket.send(packet);
148 socket.receive(packet);
159 if (socket !
[all...]
H A DSocketTest.java42 // Closing a closed socket does nothing.
60 // Now close the socket...
92 ssc.socket().bind(listenAddr, 0);
93 ServerSocket ss = ssc.socket();
95 // Open a socket to the local port.
99 out.socket().setTcpNoDelay(false);
101 InetSocketAddress addr = new InetSocketAddress(host, ssc.socket().getLocalPort());
109 in.socket().setTcpNoDelay(false);
112 InetSocketAddress outRemoteAddress = (InetSocketAddress) out.socket().getRemoteSocketAddress();
113 InetSocketAddress outLocalAddress = (InetSocketAddress) out.socket()
[all...]
H A DOldUnixSocketTest.java106 Socket socket = new Socket("127.0.0.1", port, false);
107 OutputStream o = socket.getOutputStream();
113 socket.close();
/libcore/luni/src/main/java/java/util/logging/
H A DSocketHandler.java25 * A handler that writes log messages to a socket connection.
62 // the socket connection
63 private Socket socket; field in class:SocketHandler
102 // Initialize the socket connection and prepare the output stream
120 this.socket = new Socket(host, p);
126 super.internalSetOutputStream(new BufferedOutputStream(this.socket.getOutputStream()));
136 if (this.socket != null) {
137 this.socket.close();
138 this.socket = null;
141 getErrorManager().error("Exception occurred when closing the socket handle
[all...]
/libcore/support/src/test/java/org/apache/harmony/xnet/tests/support/
H A DSSLSocketFactoryImpl.java17 public Socket createSocket(Socket socket, String s, int i, boolean flag) argument
19 if (socket == null) {
20 throw new IOException("incorrect socket");
30 socket = new Socket(s, i);
32 socket = new Socket(s, i);
33 socket.close();
35 return socket;
/libcore/luni/src/main/java/javax/net/ssl/
H A DX509KeyManager.java39 * @param socket
40 * the socket for the connection, or {@code null} if
41 * the alias selected does not depend on a specific socket.
46 Socket socket);
57 * @param socket
58 * the socket for the connection, or {@code null} if
59 * the alias selected does not depend on a specific socket.
64 Socket socket);
45 chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket) argument
63 chooseServerAlias(String keyType, Principal[] issuers, Socket socket) argument
/libcore/luni/src/test/java/libcore/javax/net/
H A DServerSocketFactoryTest.java75 Socket socket = new Socket(InetAddress.getLocalHost(), serverSocket.getLocalPort());
79 InputStream in = socket.getInputStream();
83 socket.close();
98 Socket socket = new Socket();
99 backlog.add(socket);
100 socket.connect(serverAddress, 500);
109 for (Socket socket : backlog) {
110 socket.close();
/libcore/luni/src/test/java/tests/api/javax/net/ssl/
H A DHandshakeCompletedEventTest.java75 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
76 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
90 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
91 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
101 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
102 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
112 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
113 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
124 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
125 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, sessio
202 private SSLSocket socket; field in class:HandshakeCompletedEventTest
[all...]
/libcore/luni/src/test/java/libcore/java/nio/channels/
H A DServerSocketChannelTest.java27 ssc.socket().bind(null);
H A DDatagramChannelTest.java51 dc.socket().bind(null);
/libcore/luni/src/main/native/
H A DNetworkUtilities.h18 #include <sys/socket.h>
25 // operation on a socket, since all our sockets are AF_INET6.
32 // or an IPv4-mapped IPv6 address, and for the MCAST_JOIN_GROUP socket option.
/libcore/luni/src/main/java/java/nio/channels/
H A DServerSocketChannel.java27 * stream-oriented listening socket. Binding and manipulation of socket options
29 * by calling {@code socket()}. ServerSocketChannels can not be constructed for
30 * an already existing server-socket, nor can a {@link java.net.SocketImpl} be assigned.
32 * A server-socket channel is open but not bound when created by the {@code
50 * Creates an open and unbound server-socket channel.
64 * Gets the valid operations of this channel. Server-socket channels support
77 * Return the server-socket assigned this channel, which does not declare
80 * @return the server-socket assigned to this channel.
82 public abstract ServerSocket socket(); method in class:ServerSocketChannel
[all...]
/libcore/luni/src/main/java/libcore/net/http/
H A DHttpConnectionPool.java76 Socket socket = connection.getSocket();
77 SocketTagger.get().tag(socket);
91 Socket socket = connection.getSocket();
93 SocketTagger.get().untag(socket);
H A DHttpConnection.java52 private final Socket socket; field in class:HttpConnection
86 this.socket = socketCandidate;
137 IoUtils.closeQuietly(socket);
141 socket.setSoTimeout(readTimeout);
151 outputStream = socket.getOutputStream();
164 * Buffer the socket stream to permit efficient parsing of HTTP
167 * bytes intended for the SSL socket.
171 ? socket.getInputStream()
172 : new BufferedInputStream(socket.getInputStream(), bufferSize);
178 return sslSocket != null ? sslSocket : socket;
[all...]
/libcore/support/src/test/java/tests/http/
H A DMockWebServer.java196 logger.log(Level.WARNING, "MockWebServer server socket close failed", e);
203 logger.log(Level.WARNING, "MockWebServer socket close failed", e);
215 Socket socket;
217 socket = serverSocket.accept();
224 socket.close();
226 openClientSockets.add(socket);
227 serveConnection(socket);
254 Socket socket;
259 socket = sslSocketFactory.createSocket(
261 ((SSLSocket) socket)
[all...]
/libcore/luni/src/main/java/libcore/io/
H A DIoUtils.java70 * Closes 'socket', ignoring any exceptions. Does nothing if 'socket' is null.
72 public static void closeQuietly(Socket socket) { argument
73 if (socket != null) {
75 socket.close();
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/
H A DHttpURLConnectionTest.java93 Socket socket = serverSocket.accept();
94 socket.setSoTimeout(1000);
96 int num = socket.getInputStream().read(buff);
97 socket.getOutputStream().write((
101 num = socket.getInputStream().read(buff);
104 socket = serverSocket.accept();
105 socket.setSoTimeout(1000);
106 num = socket.getInputStream().read(buff);
112 socket.getOutputStream().write((
/libcore/support/src/test/java/libcore/javax/net/ssl/
H A DTestKeyManager.java63 public String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) { argument
71 dumpSocket(socket);
73 return dumpAlias(keyManager.chooseClientAlias(keyTypes, issuers, socket));
88 public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) { argument
94 dumpSocket(socket);
96 return dumpAlias(keyManager.chooseServerAlias(keyType, issuers, socket));
99 private void dumpSocket(Socket socket) { argument
100 out.print(" | socket: ");
101 out.print(String.valueOf(socket));
/libcore/luni/src/test/java/libcore/java/io/
H A DInterruptedStreamTest.java107 * Returns a pair of connected sockets backed by NIO socket channels.
111 serverSocketChannel.socket().bind(new InetSocketAddress(0));
113 clientSocketChannel.connect(serverSocketChannel.socket().getLocalSocketAddress());
116 return new Socket[] { clientSocketChannel.socket(), server.socket() };

Completed in 569 milliseconds

123