Class that implements the TCP expecific communication and extends the AComm class. More...
Public Types | |
enum | DescriptorPortType { DATA , MGMT , STATUS } |
Types for requesting descriptiors with default port values. | |
Public Member Functions | |
TcpConnection (string descriptor) | |
Initialize new class instance based on descriptor string. More... | |
TcpConnection (string IpAddress, int port) | |
Initialize new class instance. | |
override void | Close () |
Closes a connection. More... | |
override void | Open () |
Opens a connection. More... | |
override byte[] | Read () |
Read all bytes available. More... | |
override void | Write (byte[] dataOut) |
Writes all bytes from the array passed in. More... | |
![]() | |
virtual void | Read (BinaryWriter binDataIn) |
Reads all bytes available into the stream passed in. More... | |
virtual void | WaitForData (int msTimeOut) |
Waits until data available BytesAvailable in current thread. Current thread sleeps until data received or timeout reached. Blocking call. More... | |
virtual void | Write (BinaryReader binReader) |
Write from input stream to output stream More... | |
virtual void | WriteAndWaitForResponse (BinaryWriter binDataIn, BinaryReader binDataOut, int responseStartTimeOut, int responseEndTimeOut, string completetionToken) |
Write binDataOut stream data to output stream and return data received in binDataIn stream. Data returned is any data received or up to completion token if received. Wait for response timeout before returning. More... | |
virtual byte[] | WriteAndWaitForResponse (byte[] dataOut, int responseStartTimeOut, int responseEndTimeOut, string completetionToken) |
Write byte data to output stream and return data received. Data returned is any data received or up to completion token if received. Wait for response timeout before returning. More... | |
Static Public Member Functions | |
static string | DescriptorValidate (string descriptorHint, DescriptorPortType portTypeHint) |
Validate/build descriptor string from descriptorHint that may or may not have a port. More... | |
Static Public Attributes | |
static readonly int | DEFAULT_DATA_PORT = 9100 |
Port for sending print data. | |
static readonly int | DEFAULT_MGMT_PORT = 3007 |
Port used to control and manage printers. | |
static readonly int | DEFAULT_STATUS_PORT = 3002 |
Port for listening to status messages from printer. More... | |
Properties | |
override int | BytesAvailable [get] |
override bool | Connected [get] |
override string | Descriptor [get] |
Returns a string description of the connection. Format: "TCP:ip:port" e.g. "TCP:127.0.0.1:9100". More... | |
string | IpAddress [get] |
IP address of connection. | |
int | Port [get] |
Port Number of connection. | |
![]() | |
abstract int | BytesAvailable [get] |
abstract bool | Connected [get] |
abstract string | Descriptor [get] |
![]() | |
int | BytesAvailable [get] |
Number of bytes available to read. This is estimate and number can change as data is received. | |
bool | Connected [get] |
true if connection is established | |
string | Descriptor [get] |
string descriptor of the connection. | |
Class that implements the TCP expecific communication and extends the AComm class.
|
inline |
Initialize new class instance based on descriptor string.
[in] | descriptor | Colon (:) separated string description of connection. Acceptable Formats:
|
|
inlinevirtual |
Closes a connection.
Implements AComm.
|
inlinestatic |
Validate/build descriptor string from descriptorHint that may or may not have a port.
descriptorHint accepted values:
|
inlinevirtual |
Opens a connection.
Implements AComm.
|
inlinevirtual |
Read all bytes available.
Implements AComm.
|
inlinevirtual |
Writes all bytes from the array passed in.
Implements AComm.
|
static |
Port for listening to status messages from printer.
Printer may be configured to send status messages to different ports based on the "Ret. Status Port" setting on the printer. If the "Ret. Status Port" is set to "E-NET Stat Port", the printer may send status messages to the "Status Port Number" setting which has a default of 3002.
e.g. Emulation (printer language such as PGL) diagnostic messages from printer.
e.g. Capturing ODV barcode data and grade with the following printer menu settings:
|
get |
Returns a string description of the connection. Format: "TCP:ip:port" e.g. "TCP:127.0.0.1:9100".
Format returned:
Note that "TCP" prefix on returned string to denote the type of connection.