class PFTPServer: public PFTP

File Transfer Protocol server channel class

Inheritance:


Public Methods

[more] PFTPServer ()
declare a server socket
[more] ~PFTPServer ()
Delete the server, cleaning up passive sockets.
[more]virtual PString GetHelloString (const PString & user) const
Get the string printed when a user logs in default value is a string giving the user name
[more]virtual PString GetGoodbyeString (const PString & user) const
return the string printed just before exiting
[more]virtual PString GetSystemTypeString () const
return the string to be returned by the SYST command
[more]BOOL GetAllowThirdPartyPort () const
return the thirdPartyPort flag, allowing 3 host put and get.
[more]void SetAllowThirdPartyPort (BOOL state)
Set the thirdPartyPort flag.
[more]BOOL ProcessCommand ()
Process commands, dispatching to the appropriate virtual function.
[more]virtual BOOL DispatchCommand ( PINDEX code, const PString & args )
Dispatching to the appropriate virtual function.
[more]virtual BOOL CheckLoginRequired ( PINDEX cmd )
Check to see if the command requires the server to be logged in before it may be processed.
[more]virtual BOOL AuthoriseUser ( const PString & user, const PString & password, BOOL & replied )
Validate the user name and password for access.
[more]virtual BOOL OnUnknown ( const PCaselessString & command )
Handle an unknown command.
[more]virtual void OnError ( PINDEX errorCode, PINDEX cmdNum, const char * msg )
Handle an error in command.
[more]virtual void OnSyntaxError ( PINDEX cmdNum Command that had the syntax error. )
Called for syntax errors in commands.
[more]virtual void OnNotImplemented ( PINDEX cmdNum Command that was not implemented. )
Called for unimplemented commands.
[more]virtual void OnCommandSuccessful ( PINDEX cmdNum Command that had was successful. )
Called for successful commands.
[more]void SendToClient ( const PFilePath & filename File name to send. )
Send the specified file to the client.

Protected Methods

[more]BOOL OnOpen ()
Call back to verify open succeeded in an PInternetProtocol class


Inherited from PFTP:

Public Classes

oenum Commands
oenum RepresentationType
oenum DataChannelType
oenum NameTypes

Public Methods

oBOOL SendPORT( const PIPSocket::Address & addr, WORD port )


Inherited from PInternetProtocol:

Public Methods

ovirtual BOOL Read( void * buf, PINDEX len )
ovirtual BOOL Write( const void * buf, PINDEX len )
ovoid SetReadLineTimeout( const PTimeInterval & t )
ovirtual BOOL Connect( const PString & address, WORD port = 0 )
ovirtual BOOL Accept( PSocket & listener )
oconst PString& GetDefaultService() const
oPIPSocket* GetSocket() const
ovirtual BOOL WriteLine( const PString & line )
ovirtual BOOL ReadLine( PString & line, BOOL allowContinuation = FALSE )
ovirtual void UnRead( int ch )
ovirtual BOOL WriteCommand( PINDEX cmdNumber )
ovirtual BOOL ReadCommand( PINDEX & num, PString & args )
ovirtual BOOL WriteResponse( unsigned numericCode, const PString & info )
ovirtual BOOL ReadResponse()
ovirtual int ExecuteCommand( PINDEX cmdNumber )
oint GetLastResponseCode() const
oPString GetLastResponseInfo() const

Protected Methods

ovirtual PINDEX ParseResponse( const PString & line )


Inherited from PIndirectChannel:

Public

Construction

Overrides from class PObject

Overrides from class PChannel

Channel establish functions

Protected Fields

oPChannel* readChannel
oBOOL readAutoDelete
oPChannel* writeChannel
oBOOL writeAutoDelete
oPReadWriteMutex channelPointerMutex


Inherited from PChannel:

Public Methods

ostatic BOOL ConvertOSError( int libcReturnValue, Errors & lastError, int & osError )

Public

Information functions

Reading functions

Writing functions

Miscellaneous functions

Error functions

Protected Fields

oint os_handle
oErrors lastErrorCode[NumErrorGroups+1]
oint lastErrorNumber[NumErrorGroups+1]
oPINDEX lastReadCount
oPINDEX lastWriteCount
oPTimeInterval readTimeout
oPTimeInterval writeTimeout

Protected Methods

ovirtual BOOL ConvertOSError( int libcReturnValue, ErrorGroup group = LastGeneralError )
oBOOL SetErrorValues( Errors errorCode, int osError, ErrorGroup group = LastGeneralError )
oint ReadCharWithTimeout( PTimeInterval & timeout )


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions


Documentation

File Transfer Protocol server channel class
o PFTPServer()
declare a server socket

o ~PFTPServer()
Delete the server, cleaning up passive sockets.

ovirtual PString GetHelloString(const PString & user) const
Get the string printed when a user logs in default value is a string giving the user name

ovirtual PString GetGoodbyeString(const PString & user) const
return the string printed just before exiting

ovirtual PString GetSystemTypeString() const
return the string to be returned by the SYST command

oBOOL GetAllowThirdPartyPort() const
return the thirdPartyPort flag, allowing 3 host put and get.

ovoid SetAllowThirdPartyPort(BOOL state)
Set the thirdPartyPort flag.

oBOOL ProcessCommand()
Process commands, dispatching to the appropriate virtual function. This is used when the socket is acting as a server.

Returns:
TRUE if more processing may be done, FALSE if the QUIT command was received or the OnUnknown() function returns FALSE.

ovirtual BOOL DispatchCommand( PINDEX code, const PString & args )
Dispatching to the appropriate virtual function. This is used when the socket is acting as a server.

Returns:
TRUE if more processing may be done, FALSE if the QUIT command was received or the OnUnknown() function returns FALSE.
Parameters:
code - Parsed command code.
args - Arguments to command.

ovirtual BOOL CheckLoginRequired( PINDEX cmd )
Check to see if the command requires the server to be logged in before it may be processed.

Returns:
TRUE if the command required the user to be logged in.
Parameters:
cmd - Command to check if log in required.

ovirtual BOOL AuthoriseUser( const PString & user, const PString & password, BOOL & replied )
Validate the user name and password for access. After three invalid attempts, the socket will close and FALSE is returned.

Default implementation returns TRUE for all strings.

Returns:
TRUE if user can access, otherwise FALSE
Parameters:
user - User name to authorise.
password - Password supplied for the user.
replied - Indication that a reply was sent to client.

ovirtual BOOL OnUnknown( const PCaselessString & command )
Handle an unknown command.

Returns:
TRUE if more processing may be done, FALSE if the ProcessCommand() function is to return FALSE.
Parameters:
command - Complete command line received.

ovirtual void OnError( PINDEX errorCode, PINDEX cmdNum, const char * msg )
Handle an error in command.

Returns:
TRUE if more processing may be done, FALSE if the ProcessCommand() function is to return FALSE.
Parameters:
errorCode - Error code to use
cmdNum - Command that had the error.
msg - Error message.

ovirtual void OnSyntaxError( PINDEX cmdNum Command that had the syntax error. )
Called for syntax errors in commands.

ovirtual void OnNotImplemented( PINDEX cmdNum Command that was not implemented. )
Called for unimplemented commands.

ovirtual void OnCommandSuccessful( PINDEX cmdNum Command that had was successful. )
Called for successful commands.

ovoid SendToClient( const PFilePath & filename File name to send. )
Send the specified file to the client.

oBOOL OnOpen()
Call back to verify open succeeded in an PInternetProtocol class


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.