escpos-php
Public Member Functions | List of all members
Mike42\Escpos\PrintConnectors\NetworkPrintConnector Class Reference

PrintConnector for directly opening a network socket to a printer to send it commands. More...

Inheritance diagram for Mike42\Escpos\PrintConnectors\NetworkPrintConnector:
Inheritance graph
[legend]
Collaboration diagram for Mike42\Escpos\PrintConnectors\NetworkPrintConnector:
Collaboration graph
[legend]

Public Member Functions

 __construct (string $ip, int $port=9100, int $timeout=-1)
 Construct a new NetworkPrintConnector. More...
 
- Public Member Functions inherited from Mike42\Escpos\PrintConnectors\FilePrintConnector
 __construct ($filename)
 Construct new connector, given a filename. More...
 
 __destruct ()
 Print connectors should cause a NOTICE if they are deconstructed when they have not been finalized.
 
 finalize ()
 Close file pointer.
 
 read ($len)
 Read data from the printer. More...
 
 write ($data)
 Write data to the file. More...
 

Additional Inherited Members

- Protected Attributes inherited from Mike42\Escpos\PrintConnectors\FilePrintConnector
 $fp
 The file pointer to send data to.
 

Detailed Description

PrintConnector for directly opening a network socket to a printer to send it commands.

Constructor & Destructor Documentation

◆ __construct()

Mike42\Escpos\PrintConnectors\NetworkPrintConnector::__construct ( string  $ip,
int  $port = 9100,
int  $timeout = -1 
)

Construct a new NetworkPrintConnector.

Parameters
string$ipIP address or hostname to use.
int$portThe port number to connect on.
int$timeoutThe connection timeout, in seconds.
Exceptions
ExceptionWhere the socket cannot be opened.

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