Home | History | Annotate | Download | only in socket
      1 /*
      2  * Copyright 2007 the original author or authors.
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 package org.mockftpserver.core.socket;
     17 
     18 import java.io.IOException;
     19 import java.net.InetAddress;
     20 import java.net.Socket;
     21 
     22 /**
     23  * Default implementation of the {@link SocketFactory}; creates standard {@link Socket} instances.
     24  *
     25  * @version $Revision$ - $Date$
     26  *
     27  * @author Chris Mair
     28  */
     29 public class DefaultSocketFactory implements SocketFactory {
     30 
     31     /**
     32      * Create a new Socket instance for the specified host and port.
     33      * @param host - the IP address of the host endpoint to which the socket is connect
     34      * @param port - the port number of the enpoint to which the socket is connected
     35      * @return a new Socket
     36      * @throws IOException
     37      *
     38      * @see org.mockftpserver.core.socket.SocketFactory#createSocket(java.net.InetAddress, int)
     39      */
     40     public Socket createSocket(InetAddress host, int port) throws IOException {
     41         return new Socket(host, port);
     42     }
     43 }