ZSDK_API
1.4.957
|
Establishes a TCP connection to a printer. More...
#import <TcpPrinterConnection.h>
Instance Methods | |
(id) | - initWithAddress:andWithPort: |
Initializes a new instance of the TcpPrinterConnection class. | |
(id) | - initWithAddress:withPort:withMaxTimeoutForRead:andWithTimeToWaitForMoreData: |
Initializes a new instance of the TcpPrinterConnection class. | |
(void) | - setMaxTimeoutForOpen: |
The default time, in milliseconds, to wait for a TCP connection to open. | |
Instance Methods inherited from <ZebraPrinterConnection> | |
(NSString *) | - toString |
See the classes which implement this method for the format of the description string. | |
(NSInteger) | - getMaxTimeoutForRead |
Returns the maximum time, in milliseconds, to wait for any data to be received. | |
(NSInteger) | - getTimeToWaitForMoreData |
Returns the maximum time, in milliseconds, to wait between reads after the initial read. | |
(BOOL) | - isConnected |
Returns YES if the connection is open. | |
(BOOL) | - open |
Opens the connection to a device. | |
(void) | - close |
Closes this connection and releases any system resources associated with the connection. | |
(NSInteger) | - write:error: |
Writes the number of bytes from data to the connection. | |
(NSData *) | - read: |
Reads all the available data from the connection. | |
(BOOL) | - hasBytesAvailable |
Returns YES if at least one byte is available for reading from this connection. | |
(void) | - waitForData: |
Causes the currently executing thread to sleep until hasBytesAvailable equals YES , or for a maximum of maxTimeout milliseconds. | |
Class Methods | |
(NSInteger) | + DEFAULT_MAX_TIMEOUT_FOR_READ |
The default time, in milliseconds, to wait for any data to be received. | |
(NSInteger) | + DEFAULT_TIME_TO_WAIT_FOR_MORE_DATA |
The default time, in milliseconds, to wait in-between reads after the initial read. | |
Establishes a TCP connection to a printer.
- (id) initWithAddress: | (NSString *) | anAddress | |
andWithPort: | (NSInteger) | aPort | |
Initializes a new instance of the TcpPrinterConnection class.
This constructor will use the default timeouts for read: (ZebraPrinterConnection-p). 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.
To specify timeouts other than the defaults, use:
initWithAddress:withPort:withMaxTimeoutForRead:andWithTimeToWaitForMoreData:
anAddress | The IP Address or DNS Hostname. |
aPort | The port number. |
- (id) initWithAddress: | (NSString *) | anAddress | |
withPort: | (NSInteger) | aPort | |
withMaxTimeoutForRead: | (NSInteger) | aMaxTimeoutForRead | |
andWithTimeToWaitForMoreData: | (NSInteger) | aTimeToWaitForMoreData | |
Initializes a new instance of the TcpPrinterConnection class.
This constructor will use the specified timeouts for read: (ZebraPrinterConnection-p). 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.
anAddress | The IP Address or DNS Hostname. |
aPort | The port number. |
aMaxTimeoutForRead | The maximum time, in milliseconds, to wait for any data to be received. |
aTimeToWaitForMoreData | The maximum time, in milliseconds, to wait in-between reads after the initial read. |
- (void) setMaxTimeoutForOpen: | (int) | aTimeout |
The default time, in milliseconds, to wait for a TCP connection to open.
The default is set to the platform default.
aTimeout | Time to wait in milliseconds |