Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
  * Conditions Of Use
  *
  * This software was developed by employees of the National Institute of
  * Standards and Technology (NIST), an agency of the Federal Government.
  * Pursuant to title 15 Untied States Code Section 105, works of NIST
  * employees are not subject to copyright protection in the United States
  * and are considered to be in the public domain.  As a result, a formal
  * license is not needed to use the software.
 *
 * This software is provided by NIST as a service and is expressly
 * provided "AS IS."  NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
 * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
 * AND DATA ACCURACY.  NIST does not warrant or make any representations
 * regarding the use of the software or the results thereof, including but
 * not limited to the correctness, accuracy, reliability or usefulness of
 * the software.
 *
 * Permission to use this software is contingent upon your acceptance
 * of the terms of this agreement
 *
 * .
 *
 */
 package gov.nist.core.net;
 
 
 // Added by Daniel J. Martinez Manzano <dani@dif.um.es>
basic interface to the network layer

Author(s):
m.andrews
 
 public interface NetworkLayer {

    
Creates a server with the specified port, listen backlog, and local IP address to bind to. comparable to "new java.net.ServerSocket(port,backlog,bindAddress);"

Parameters:
port
backlog
bindAddress
Returns:
the server socket
 
     public ServerSocket createServerSocket(int portint backlog,
             InetAddress bindAddressthrows IOException;

    
Creates an SSL server with the specified port, listen backlog, and local IP address to bind to. Added by Daniel J. Martinez Manzano <dani@dif.um.es>

Parameters:
port
backlog
bindAddress
Returns:
the server socket
 
     public SSLServerSocket createSSLServerSocket(int portint backlog,
             InetAddress bindAddressthrows IOException;

    
Creates a stream socket and connects it to the specified port number at the specified IP address. comparable to "new java.net.Socket(address, port);"

Parameters:
address
port
Returns:
the socket
 
     public Socket createSocket(InetAddress addressint portthrows IOException;

    
Creates a stream socket and connects it to the specified port number at the specified IP address. comparable to "new java.net.Socket(address, port,localaddress);"

Parameters:
address
port
localAddress
Returns:
the socket
 
     public Socket createSocket(InetAddress addressint portInetAddress localAddressthrows IOException;

    
Creates a new Socket, binds it to myAddress:myPort and connects it to address:port.

Parameters:
address the InetAddress that we'd like to connect to.
port the port that we'd like to connect to
myAddress the address that we are supposed to bind on or null for the "any" address.
myPort the port that we are supposed to bind on or 0 for a random one.
Returns:
a new Socket, bound on myAddress:myPort and connected to address:port.
Throws:
java.io.IOException if binding or connecting the socket fail for a reason (exception relayed from the correspoonding Socket methods)
    public Socket createSocket(InetAddress addressint port,
                    InetAddress myAddressint myPort)
        throws IOException;

    
Creates a stream SSL socket and connects it to the specified port number at the specified IP address. Added by Daniel J. Martinez Manzano <dani@dif.um.es>

Parameters:
address
port
Returns:
the socket
    public SSLSocket createSSLSocket(InetAddress addressint portthrows IOException;

    
Creates a stream SSL socket and connects it to the specified port number at the specified IP address. Added by Daniel J. Martinez Manzano <dani@dif.um.es>

Parameters:
address
port
localAddress -- my address.
Returns:
the socket
    public SSLSocket createSSLSocket(InetAddress addressint portInetAddress localAddressthrows IOException;

    
Constructs a datagram socket and binds it to any available port on the local host machine. comparable to "new java.net.DatagramSocket();"

Returns:
the datagram socket
    public DatagramSocket createDatagramSocket() throws SocketException;

    
Creates a datagram socket, bound to the specified local address. comparable to "new java.net.DatagramSocket(port,laddr);"

Parameters:
port
laddr
Returns:
the datagram socket
    public DatagramSocket createDatagramSocket(int portInetAddress laddr)
            throws SocketException;
New to GrepCode? Check out our FAQ X