Opens and registers a client connection to a master.
- Parameters
-
[in] | ip | Master IP address, host name or endpoint. |
[in] | port | Master TCP port. |
[in] | callback | Callback function that receives status updates for in progress requests. |
- Exceptions
-
- Usage
- Specify the master IP address, host name or endpoint using the ip parameter and the master TCP port using the port parameter.
When specifying an endpoint, the ip parameter must be of the form tcp://host:port and the port parameter must be 0.
- To close the client connection, call close. The client connection is automatically closed when the instance is destroyed.
- If the callback function is specified, it receives status updates for in progress requests.
- Callback Example:
class StatusCallback implements OPStatusCallback {
@Override
public void statusCallback(
int connection, WString
id, WString statusMsg) {
System.out.println(statusMsg);
}
}
- See also
- close and isOpen