
/**
 * Socket factory abstraction for creating differnt types of sockets
 */
package com.jscape.inet.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;


public interface SocketFactory {
    /**
     * Creates the actual socket
     *
     * @param host the host to connect to
     * @param port The port to connect to
     *
     * @return The socket
     *
     * @throws IOException          Thrown if there is a problem connecting.
     * @throws UnknownHostException
     */
    Socket createSocket(String host, int port)
            throws IOException,
                   UnknownHostException;

    /**
     * @param socket
     *
     * @return the inputstream for the connection
     *
     * @throws IOException
     */
    InputStream getInputStream(Socket socket)
            throws IOException;


    /**
     * @param socket
     *
     * @return the outputstream for the connection
     *
     * @throws IOException
     */

    OutputStream getOutputStream(Socket socket)
            throws IOException;
}
