Here you can find the source of createSocketServer(int port)
Parameter | Description |
---|---|
port | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static ServerSocket createSocketServer(int port) throws IOException
//package com.java2s; /******************************************************************************* * *============================================================================== * * Copyright (c) 2008-2011 ayound@gmail.com * This program and the accompanying materials * are made available under the terms of the Apache License 2.0 * which accompanies this distribution, and is available at * http://www.apache.org/licenses/LICENSE-2.0 * All rights reserved./* w ww. j av a 2 s .co m*/ * * Created on 2008-11-1 *******************************************************************************/ import java.io.IOException; import java.net.ServerSocket; public class Main { /** * create socket server by default port * * @param port * @return * @throws IOException */ public static ServerSocket createSocketServer(int port) throws IOException { return new ServerSocket(port); } }