Java Socket Create createSocketServer(int port)

Here you can find the source of createSocketServer(int port)

Description

create socket server by default port

License

Apache License

Parameter

Parameter Description
port a parameter

Exception

Parameter Description
IOException an exception

Declaration

public static ServerSocket createSocketServer(int port)
        throws IOException 

Method Source Code

//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);
    }
}

Related

  1. createSocketAddr(String target)
  2. createSocketAddr(String target)
  3. createSocketAddress()
  4. createSocketAddress(String server)
  5. createSocketAddrForHost(String hostName, int port)
  6. getSocket()
  7. getSocket(String host, int port)
  8. getSocket(String host, int port)
  9. getSocket(String host, int port, int timeout)