Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.enterprisedt.net.ftp
Class FTPPassiveDataSocket

    java.lang.Object
      com.enterprisedt.net.ftp.FTPPassiveDataSocket

All Implemented Interfaces:
  FTPDataSocket

    public class FTPPassiveDataSocket

extends java.lang.Object
implements FTPDataSocket

Passive data socket handling class

Version:
  $Revision: 1.7 $
Author:
  Bruce Blackshaw

Field Summary
`static java.lang.String` | `cvsId` Revision control id
`protected java.net.Socket` | `sock` The underlying socket

Constructor Summary
`protected` | `FTPPassiveDataSocket(java.net.Socket sock)` Constructor

Method Summary
`void` | `close()` Closes underlying socket
`void` | `closeChild()` Does nothing in passive mode
`java.io.InputStream` | `getInputStream()` If active mode, accepts the FTP server's connection - in PASV, we are already connected.
`int` | `getLocalPort()` Returns the local port to which this socket is bound.
`java.io.OutputStream` | `getOutputStream()` If active mode, accepts the FTP server's connection - in PASV, we are already connected.
`void` | `setTimeout(int millis)` Set the TCP timeout on the underlying control socket.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### cvsId

    public static final java.lang.String cvsId

  Revision control id

  See Also:
    Constant Field Values

### sock

    protected java.net.Socket sock

  The underlying socket

Constructor Detail

### FTPPassiveDataSocket

    protected FTPPassiveDataSocket(java.net.Socket sock)

  Constructor

  Parameters:
    `sock` - client socket to use

Method Detail

### setTimeout

    public void setTimeout(int millis)
                    throws java.io.IOException

  Set the TCP timeout on the underlying control socket. If a timeout is set, then any operation which takes longer than the timeout value will be killed with a java.io.InterruptedException.

  Specified by:
    `setTimeout` in interface `FTPDataSocket`
  Parameters:
    `millis` - The length of the timeout, in milliseconds
  Throws:
    `java.io.IOException`

### getLocalPort

    public int getLocalPort()

  Returns the local port to which this socket is bound.

  Specified by:
    `getLocalPort` in interface `FTPDataSocket`
  Returns:
    the local port number to which this socket is bound

### getOutputStream

    public java.io.OutputStream getOutputStream()
                                         throws java.io.IOException

  If active mode, accepts the FTP server's connection - in PASV, we are already connected. Then gets the output stream of the connection

  Specified by:
    `getOutputStream` in interface `FTPDataSocket`
  Returns:
    output stream for underlying socket.
  Throws:
    `java.io.IOException`

### getInputStream

    public java.io.InputStream getInputStream()
                                       throws java.io.IOException

  If active mode, accepts the FTP server's connection - in PASV, we are already connected. Then gets the input stream of the connection

  Specified by:
    `getInputStream` in interface `FTPDataSocket`
  Returns:
    input stream for underlying socket.
  Throws:
    `java.io.IOException`

### close

    public void close()
               throws java.io.IOException

  Closes underlying socket

  Specified by:
    `close` in interface `FTPDataSocket`
  Throws:
    `java.io.IOException`

### closeChild

    public void closeChild()
                    throws java.io.IOException

  Does nothing in passive mode

  Specified by:
    `closeChild` in interface `FTPDataSocket`
  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2001-2007 Enterprise Distributed Technologies Ltd. All Rights Reserved.