public class MultichannelTcpConnection extends MultichannelConnection
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MULTICHANNEL_PRINTING_PORT
The default Multichannel printing port for Link-OS devices.
|
static int |
DEFAULT_MULTICHANNEL_STATUS_PORT
The default Multichannel status port for Link-OS devices.
|
Constructor and Description |
---|
MultichannelTcpConnection(DiscoveredPrinter discoveredPrinter,
int maxTimeoutForRead,
int timeToWaitForMoreData)
Initializes a new instance of the
MultichannelTcpConnection class. |
MultichannelTcpConnection(DiscoveredPrinter discoveredPrinter,
int printingChannelMaxTimeoutForRead,
int printingChannelTimeToWaitForMoreData,
int statusChannelMaxTimeoutForRead,
int statusChannelTimeToWaitForMoreData)
Initializes a new instance of the
MultichannelTcpConnection class. |
MultichannelTcpConnection(String ipAddress,
int printingPort,
int statusPort)
Initializes a new instance of the
MultichannelTcpConnection class. |
MultichannelTcpConnection(String ipAddress,
int printingPort,
int statusPort,
int maxTimeoutForRead,
int timeToWaitForMoreData)
Initializes a new instance of the
MultichannelTcpConnection class. |
MultichannelTcpConnection(String ipAddress,
int printingPort,
int statusPort,
int printingChannelMaxTimeoutForRead,
int printingChannelTimeToWaitForMoreData,
int statusChannelMaxTimeoutForRead,
int statusChannelTimeToWaitForMoreData)
Initializes a new instance of the
MultichannelTcpConnection class. |
Modifier and Type | Method and Description |
---|---|
ConnectionReestablisher |
getConnectionReestablisher(long thresholdTime)
Returns a
ConnectionReestablisher which allows for easy recreation of a connection which may have
been closed. |
String |
getSimpleConnectionName()
Return the IP address as the description.
|
String |
toString()
Returns
TCP_MULTI :[address]:[port number].The address and port number are the parameters which were passed into the constructor. |
addWriteLogStream, bytesAvailable, close, closePrintingChannel, closeStatusChannel, getMaxTimeoutForRead, getPrintingChannel, getStatusChannel, getTimeToWaitForMoreData, isConnected, open, openPrintingChannel, openStatusChannel, read, read, readChar, sendAndWaitForResponse, sendAndWaitForResponse, sendAndWaitForValidResponse, sendAndWaitForValidResponse, setMaxTimeoutForRead, setTimeToWaitForMoreData, waitForData, write, write, write
public static final int DEFAULT_MULTICHANNEL_PRINTING_PORT
public static final int DEFAULT_MULTICHANNEL_STATUS_PORT
public MultichannelTcpConnection(DiscoveredPrinter discoveredPrinter, int maxTimeoutForRead, int timeToWaitForMoreData)
MultichannelTcpConnection
class. This constructor will use the
specified timeouts for Connection.read()
for both channels. The timeout is a maximum of
maxTimeoutForRead
milliseconds for any data to be received. If no more data is available after
timeToWaitForMoreData
milliseconds the read operation is assumed to be complete. If you wish to
specify different timeouts for each channel, use
MultichannelTcpConnection(DiscoveredPrinter, int, int, int, int)
.discoveredPrinter
- the discovered printer.maxTimeoutForRead
- the maximum time, in milliseconds, to wait for any data to be received.timeToWaitForMoreData
- the maximum time, in milliseconds, to wait in-between reads after the initial read.public MultichannelTcpConnection(DiscoveredPrinter discoveredPrinter, int printingChannelMaxTimeoutForRead, int printingChannelTimeToWaitForMoreData, int statusChannelMaxTimeoutForRead, int statusChannelTimeToWaitForMoreData)
MultichannelTcpConnection
class. This constructor will use the
specified timeouts for Connection.read()
for the channels. The timeout is a maximum of
printingChannelMaxTimeoutForRead/statusChannelMaxTimeoutForRead
milliseconds for any data to be
received on the printing/status channels respectively. If no more data is available after
printingChannelTimeToWaitForMoreData/statusChannelTimeToWaitForMoreData
milliseconds on the
printing/status channels respectively the read operation is assumed to be complete.discoveredPrinter
- the discovered printer.printingChannelMaxTimeoutForRead
- the maximum time, in milliseconds, to wait for any data to be received on
the printing channel.printingChannelTimeToWaitForMoreData
- the maximum time, in milliseconds, to wait in-between reads after the
initial read on the printing channel.statusChannelMaxTimeoutForRead
- the maximum time, in milliseconds, to wait for any data to be received on
the status channel.statusChannelTimeToWaitForMoreData
- the maximum time, in milliseconds, to wait in-between reads after the
initial read on the status channel.public MultichannelTcpConnection(String ipAddress, int printingPort, int statusPort)
MultichannelTcpConnection
class. This constructor will use the
default timeouts for Connection.read()
. The default timeout is a maximum of 5 seconds for any data to be
received. If no more data is available after 500 milliseconds the read operation is assumed to be complete.MultichannelTcpConnection(String, int, int, int,int)
or
MultichannelTcpConnection(String, int, int, int, int, int, int)
.ipAddress
- the IP Address or DNS Hostname.printingPort
- the printing port number.statusPort
- the status port number.public MultichannelTcpConnection(String ipAddress, int printingPort, int statusPort, int maxTimeoutForRead, int timeToWaitForMoreData)
MultichannelTcpConnection
class. This constructor will use the
specified timeouts for Connection.read()
for both channels. The timeout is a maximum of
maxTimeoutForRead
milliseconds for any data to be received. If no more data is available after
timeToWaitForMoreData
milliseconds the read operation is assumed to be complete. If you wish to
specify different timeouts for each channel, use
MultichannelTcpConnection(String, int, int, int, int, int, int)
.ipAddress
- the IP Address or DNS Hostname.printingPort
- the printing port number.statusPort
- the status port number.maxTimeoutForRead
- the maximum time, in milliseconds, to wait for any data to be received.timeToWaitForMoreData
- the maximum time, in milliseconds, to wait in-between reads after the initial read.public MultichannelTcpConnection(String ipAddress, int printingPort, int statusPort, int printingChannelMaxTimeoutForRead, int printingChannelTimeToWaitForMoreData, int statusChannelMaxTimeoutForRead, int statusChannelTimeToWaitForMoreData)
MultichannelTcpConnection
class. This constructor will use the
specified timeouts for Connection.read()
for the channels. The timeout is a maximum of
printingChannelMaxTimeoutForRead/statusChannelMaxTimeoutForRead
milliseconds for any data to be
received on the printing/status channels respectively. If no more data is available after
printingChannelTimeToWaitForMoreData/statusChannelTimeToWaitForMoreData
milliseconds on the
printing/status channels respectively the read operation is assumed to be complete.ipAddress
- the IP Address or DNS Hostname.printingPort
- the printing port number.statusPort
- the status port number.printingChannelMaxTimeoutForRead
- the maximum time, in milliseconds, to wait for any data to be received on
the printing channel.printingChannelTimeToWaitForMoreData
- the maximum time, in milliseconds, to wait in-between reads after the
initial read on the printing channel.statusChannelMaxTimeoutForRead
- the maximum time, in milliseconds, to wait for any data to be received on
the status channel.statusChannelTimeToWaitForMoreData
- the maximum time, in milliseconds, to wait in-between reads after the
initial read on the status channel.public ConnectionReestablisher getConnectionReestablisher(long thresholdTime) throws ConnectionException
Connection
ConnectionReestablisher
which allows for easy recreation of a connection which may have
been closed.
getConnectionReestablisher
in interface Connection
getConnectionReestablisher
in class MultichannelConnection
thresholdTime
- how long the Connection reestablisher will wait before attempting to reconnection to the
printerConnectionException
- if the ConnectionReestablisher could not be created.Connection.getConnectionReestablisher(long thresholdTime)
public String toString()
TCP_MULTI
:[address]:[port number].address
and port number
are the parameters which were passed into the constructor.toString
in interface Connection
toString
in class Object
Object.toString()
public String getSimpleConnectionName()
Connection.getSimpleConnectionName()
© 2017 ZIH Corp. All Rights Reserved.