Functions | |
| JCONNECTION | jsOpenConnection (char const *const host) |
| Opens a connection to the specified host. More... | |
| JCONNECTION | jsOpenConnectionInt (int const host) |
| Opens a connection to the specified host. More... | |
| JCONNECTION | jsOpenConnectionBase (char const *const host, UINT32 const cableID) |
| Opens a connection to the specified scanner using Base IP + Cable ID addressing. More... | |
| int | jsCloseConnection (JCONNECTION const jc) |
Closes a JCONNECTION. More... | |
JCONNECTION's are allocated data structures that must be properly de-allocated; otherwise, there will be memory leaks in your program. Consequently, every successful call to jsOpenConnection() or jsOpenConnectionInt() must have a corresponding call to jsCloseConnection(). If the open call failed, the returned JCONNECTION will be NULL and the close call is not necessary, although it is perfectly safe.
After calling jsCloseConnection(), the JCONNECTION is an invalid pointer and should be set to NULL.
If a call fails, call WSAGetLastError() to get a more specific reason for failure according to Microsoft's documentation.
| int jsCloseConnection | ( | JCONNECTION const | jc | ) |
Closes a JCONNECTION.
It is safe to pass in NULL.
If a function returns SCANNER_FAILURE, you must close the connection with this function. JCONNECTION's are allocated data structures that must be properly deallocated, otherwise there will be memory leaks in your program.
| jc | The connection to be closed. |
| JCONNECTION jsOpenConnection | ( | char const *const | host | ) |
Opens a connection to the specified host.
All successful calls to this function must be closed with a call to jsCloseConnection().
jsCloseConnection() | host | Can be in either xxx.xxx.xxx.xxx format or can be a DNS name for lookup. |
JCONNECTION on success. NULL if a failure occurred. | JCONNECTION jsOpenConnectionBase | ( | char const *const | host, |
| UINT32 const | cableID | ||
| ) |
Opens a connection to the specified scanner using Base IP + Cable ID addressing.
All successful calls to this function must be closed with a call to jsCloseConnection().
jsCloseConnection() | host | Must be in xxx.xxx.xxx.xxx format. |
| cableID | The Cable ID of the scanner to connect to. |
JCONNECTION on success. NULL if a failure occurred. | JCONNECTION jsOpenConnectionInt | ( | int const | host | ) |
Opens a connection to the specified host.
All successful calls to this function must be closed with a call to jsCloseConnection().
jsCloseConnection() | host | Must be in network byte order. The best way to get this is by using the Scanner Discovery functions. |
JCONNECTION on success. NULL if a failure occurred.