GPC  v1.0.0-2516
Gorman Print Control
BinaryProtocolConnection Class Referencefinal
Collaboration diagram for BinaryProtocolConnection:

Public Member Functions

 BinaryProtocolConnection (const std::string ip, const int tcp)
 Constructor. More...
 
 ~BinaryProtocolConnection (void)
 Destructor. More...
 
BinaryProtocolConnectionconnect (void)
 Connect to the IncJet device. More...
 
BinaryProtocolConnectioninitiate_communications (void)
 Initiate communications. More...
 
BinaryProtocolConnectionsend_file (const bool is_ijs, const VBytes &file_contents)
 Upload a file. More...
 
BinaryProtocolConnectionsend_eof (void)
 Send end-of-file. More...
 
BinaryProtocolConnectionwrite_and_expect_ack (const BinaryProtocol &bp)
 Write the specified command and expect the IncJet device to reply with an ACK (0x09). More...
 

Public Attributes

int port
 
std::string ip_address
 
std::string name
 
StreamingSocket sock
 

Constructor & Destructor Documentation

◆ BinaryProtocolConnection()

BinaryProtocolConnection::BinaryProtocolConnection ( const std::string  ip,
const int  tcp 
)

Constructor.

◆ ~BinaryProtocolConnection()

BinaryProtocolConnection::~BinaryProtocolConnection ( void  )

Destructor.

Member Function Documentation

◆ connect()

BinaryProtocolConnection & BinaryProtocolConnection::connect ( void  )

Connect to the IncJet device.

Exceptions
Lox::Exceptionif the TCP connection fails

Referenced by SessionComponentTransfer::run().

Here is the caller graph for this function:

◆ initiate_communications()

BinaryProtocolConnection & BinaryProtocolConnection::initiate_communications ( void  )

Initiate communications.

Exceptions
Lox::Exceptionif there is an error while waiting to read from the socket
Lox::Exceptionif there was a timeout while waiting to read from the socket
Lox::Exceptionif there was an unknown/undocumented problem while waiting to read from the socket
Lox::Exceptionif the first thing read from the device is unexpected
Lox::Exceptionif we fail to write to the socket

References BinaryProtocol::code, BinaryProtocol::content, and BinaryProtocol::create().

Referenced by SessionComponentTransfer::run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_file()

BinaryProtocolConnection & BinaryProtocolConnection::send_file ( const bool  is_ijs,
const VBytes &  file_contents 
)

Upload a file.

References BinaryProtocol::append(), BinaryProtocol::create(), and write_and_expect_ack().

Referenced by SessionComponentTransfer::run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_eof()

BinaryProtocolConnection & BinaryProtocolConnection::send_eof ( void  )

Send end-of-file.

References BinaryProtocol::create(), and write_and_expect_ack().

Referenced by SessionComponentTransfer::run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_and_expect_ack()

BinaryProtocolConnection & BinaryProtocolConnection::write_and_expect_ack ( const BinaryProtocol bp)

Write the specified command and expect the IncJet device to reply with an ACK (0x09).

Exceptions
Lox::Exceptionif we fail to write to the socket

References BinaryProtocol::code, BinaryProtocol::content, BinaryProtocol::describe(), and BinaryProtocol::message_data().

Referenced by send_eof(), and send_file().

Here is the call graph for this function:
Here is the caller graph for this function: