Lines Matching defs:socket

141                     Socket socket = createSocket();
142 if (localAddress != null) socket.bind(localAddress);
143 socket.connect(new InetSocketAddress(hostAddresses[i], port));
144 return socket;
160 Socket socket = createSocket();
161 socket.bind(new InetSocketAddress(localAddress, localPort));
162 socket.connect(new InetSocketAddress(address, port));
163 return socket;
168 Socket socket = createSocket();
169 socket.connect(new InetSocketAddress(host, port));
170 return socket;
180 Socket socket = new Socket();
181 bindSocket(socket);
182 return socket;
301 * socket will be sent on this {@code Network}, irrespective of any process-wide network binding
302 * set by {@link ConnectivityManager#setProcessDefaultNetwork}. The socket must not be
305 public void bindSocket(DatagramSocket socket) throws IOException {
306 // Apparently, the kernel doesn't update a connected UDP socket's routing upon mark changes.
307 if (socket.isConnected()) {
310 // Query a property of the underlying socket to ensure that the socket's file descriptor
312 socket.getReuseAddress();
313 bindSocketFd(socket.getFileDescriptor$());
317 * Binds the specified {@link Socket} to this {@code Network}. All data traffic on the socket
319 * {@link ConnectivityManager#setProcessDefaultNetwork}. The socket must not be connected.
321 public void bindSocket(Socket socket) throws IOException {
322 // Apparently, the kernel doesn't update a connected TCP socket's routing upon mark changes.
323 if (socket.isConnected()) {
326 // Query a property of the underlying socket to ensure that the socket's file descriptor
328 socket.getReuseAddress();
329 bindSocketFd(socket.getFileDescriptor$());
336 throw new ErrnoException("Binding socket to network " + netId, -err)