Here you can find the source of createServerSocket(int port)
public static ServerSocket createServerSocket(int port) throws IOException
//package com.java2s; import java.net.*; import java.io.*; public class Main { public static final int RECV_BUF_SIZE = 1000000; public static ServerSocket createServerSocket(int port) throws IOException { ServerSocket server = new ServerSocket(port); server.setReceiveBufferSize(RECV_BUF_SIZE); return server; }//from w w w.j a va2s . co m }