Here you can find the source of openTcpSocket(boolean blocking)
public static SocketChannel openTcpSocket(boolean blocking)
//package com.java2s; //License from project: Open Source License import java.nio.channels.SocketChannel; public class Main { /**/* ww w. j a va2s .com*/ * Open and return a socket channel with the specified blocking mode enabled or * {@code null} if there is an error opening the channel. */ public static SocketChannel openTcpSocket(boolean blocking) { try { return (SocketChannel) SocketChannel.open().configureBlocking(blocking); } catch (Exception ex) { return null; } } }