plptools
Loading...
Searching...
No Matches
wprt Class Reference

Remote Print services via PLP. More...

#include <wprt.h>

Collaboration diagram for wprt:

Public Member Functions

 wprt (TCPSocket *)
 
 ~wprt ()
 Virtual destructor. More...
 
void reset ()
 Initializes a connection to the remote machine. More...
 
void reconnect ()
 Attempts to re-establish a remote connection by first closing the socket, then connecting again to the ncpd daemon and finally calling reset. More...
 
Enum< rfsv::errsgetStatus ()
 Retrieves the current status of the connection. More...
 
Enum< rfsv::errsgetData (bufferStore &buf)
 Get Print Data. More...
 
Enum< rfsv::errsinitPrinter ()
 Init Printer. More...
 
Enum< rfsv::errscancelJob ()
 Cancels a running job. More...
 
bool stop ()
 Stops the WPRT server. More...
 

Protected Types

enum  commands { WPRT_INIT = 0x00 , WPRT_GET = 0xf0 , WPRT_CANCEL = 0xf1 , WPRT_STOP = 0xff }
 The possible commands. More...
 

Protected Member Functions

bool sendCommand (enum commands cc, bufferStore &data)
 Sends a command to the remote side. More...
 
Enum< rfsv::errsgetResponse (bufferStore &data)
 
const char * getConnectName ()
 

Protected Attributes

TCPSocketskt
 The socket, used for communication with ncpd. More...
 
Enum< rfsv::errsstatus
 The current status of the connection. More...
 

Detailed Description

Remote Print services via PLP.

Definition at line 34 of file wprt.h.

Member Enumeration Documentation

◆ commands

enum wprt::commands
protected

The possible commands.

Enumerator
WPRT_INIT 
WPRT_GET 
WPRT_CANCEL 
WPRT_STOP 

Definition at line 89 of file wprt.h.

Constructor & Destructor Documentation

◆ wprt()

wprt::wprt ( TCPSocket _skt)

Definition at line 35 of file wprt.cc.

◆ ~wprt()

wprt::~wprt ( )

Virtual destructor.

Definition at line 41 of file wprt.cc.

Member Function Documentation

◆ cancelJob()

Enum< rfsv::errs > wprt::cancelJob ( )

Cancels a running job.

Definition at line 137 of file wprt.cc.

◆ getConnectName()

const char * wprt::getConnectName ( void  )
protected

Definition at line 77 of file wprt.cc.

◆ getData()

Enum< rfsv::errs > wprt::getData ( bufferStore buf)

Get Print Data.

Definition at line 127 of file wprt.cc.

◆ getResponse()

Enum< rfsv::errs > wprt::getResponse ( bufferStore data)
protected

Definition at line 154 of file wprt.cc.

◆ getStatus()

Enum< rfsv::errs > wprt::getStatus ( void  )

Retrieves the current status of the connection.

Returns
The connection status.

Definition at line 71 of file wprt.cc.

◆ initPrinter()

Enum< rfsv::errs > wprt::initPrinter ( )

Init Printer.

Definition at line 108 of file wprt.cc.

◆ reconnect()

void wprt::reconnect ( void  )

Attempts to re-establish a remote connection by first closing the socket, then connecting again to the ncpd daemon and finally calling reset.

Definition at line 49 of file wprt.cc.

◆ reset()

void wprt::reset ( void  )

Initializes a connection to the remote machine.

Definition at line 57 of file wprt.cc.

◆ sendCommand()

bool wprt::sendCommand ( enum commands  cc,
bufferStore data 
)
protected

Sends a command to the remote side.

If communication fails, a reconnect is triggered and a second attempt to transmit the request is attempted. If that second attempt fails, the function returns an error an sets rpcs::status to E_PSI_FILE_DISC.

Parameters
ccThe command to execute on the remote side.
dataAdditional data for this command.
Returns
true on success, false on failure.

Definition at line 86 of file wprt.cc.

◆ stop()

bool wprt::stop ( )

Stops the WPRT server.

Definition at line 148 of file wprt.cc.

Member Data Documentation

◆ skt

TCPSocket* wprt::skt
protected

The socket, used for communication with ncpd.

Definition at line 100 of file wprt.h.

◆ status

Enum<rfsv::errs> wprt::status
protected

The current status of the connection.

Definition at line 105 of file wprt.h.


The documentation for this class was generated from the following files: