27 #ifndef PTLIB_INETPROT_H
28 #define PTLIB_INETPROT_H
69 char const *
const * cmdNames
285 unsigned numericCode,
411 #endif // PTLIB_INETPROT_H
virtual bool WriteCommand(PINDEX cmdNumber, const PString ¶m=PString::Empty())
Write a single line for a command.
This class contains the Multipurpose Internet Mail Extensions parameters and variables.
Definition: mime.h:48
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:51
virtual PBoolean ReadCommand(PINDEX &num, PString &args)
Read a single line of a command which ends with a CR/LF pair.
Array of characters.
Definition: array.h:552
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:2164
int GetLastResponseCode() const
Return the code associated with the last response received by the socket.
Definition: inetprot.h:347
Error during other operation, eg Open()
Definition: channel.h:254
PString GetLastResponseInfo() const
Return the last response received by the socket.
Definition: inetprot.h:355
PCharArray unReadBuffer
Definition: inetprot.h:383
PINDEX unReadCount
Definition: inetprot.h:386
This class describes a type of socket that will communicate using the Internet Protocol.
Definition: ipsock.h:47
Definition: inetprot.h:393
Definition: inetprot.h:393
This is a channel that operates indirectly through another channel(s).
Definition: indchan.h:45
This is an array collection class of PString objects.
Definition: pstring.h:2365
bool SetLastResponse(int code, const PString &info, ErrorGroup group=LastGeneralError)
virtual PBoolean WriteResponse(unsigned numericCode, const PString &info)
Write a response code followed by a text string describing the response to a command.
virtual int ExecuteCommand(PINDEX cmdNumber)
Write a command to the socket, using WriteCommand() and await a response using ReadResponse().
Definition: inetprot.h:393
PString defaultServiceName
Definition: inetprot.h:377
A TCP/IP socket for process/application layer high level protocols.
Definition: inetprot.h:61
PBoolean newLineToCRLF
Definition: inetprot.h:397
void SetReadLineTimeout(const PTimeInterval &t)
Set the maximum timeout between characters within a line.
enum PInternetProtocol::StuffState stuffingState
PStringArray commandNames
Definition: inetprot.h:380
PString m_lastResponseInfo
Definition: inetprot.h:402
bool PBoolean
Definition: object.h:174
Definition: inetprot.h:393
virtual PBoolean WriteLine(const PString &line)
Write a string to the socket channel followed by a CR/LF pair.
The character string class.
Definition: pstring.h:108
int m_lastResponseCode
Definition: inetprot.h:401
virtual PBoolean Connect(const PString &address, WORD port=0)
Connect a socket to a remote host for the internet protocol.
ErrorGroup
Error groups.
Definition: channel.h:251
Definition: inetprot.h:393
virtual int ReadChar()
Read a single 8 bit byte from the channel.
static const PString & Empty()
Return an empty string.
virtual void UnRead(int ch)
Put back the characters into the data stream so that the next Read() function call will return them f...
Definition: inetprot.h:393
PInternetProtocol(const char *defaultServiceName, PINDEX cmdCount, char const *const *cmdNames)
PIPSocket * GetSocket() const
Get the eventual socket for the series of indirect channels that may be between the current protocol ...
const PString & GetDefaultService() const
Get the default service name or port number to use in socket connections.
StuffState
Definition: inetprot.h:392
virtual PBoolean Write(const void *buf, PINDEX len)
Low level write to the channel.
virtual PBoolean ReadResponse()
Read a response code followed by a text string describing the response to a command.
A network communications channel.
Definition: socket.h:59
virtual PBoolean Read(void *buf, PINDEX len)
Low level read from the channel.
PTimeInterval readLineTimeout
Definition: inetprot.h:389
virtual PBoolean ReadLine(PString &line, PBoolean allowContinuation=false)
Read a string from the socket channel up to a CR/LF pair.
virtual PINDEX ParseResponse(const PString &line)
Parse a response line string into a response code and any extra info on the line. ...
virtual PBoolean Accept(PSocket &listener)
Accept a server socket to a remote host for the internet protocol.