close method

  1. @override
Future<int> close(
  1. int handle
)
override

Piggyback Capture's close and use parameters and interfaces unique to http connections Implement JSON Rpc protocols.

Implementation

@override

/// Piggyback Capture's close and use parameters and interfaces unique to http connections
/// Implement JSON Rpc protocols.
Future<int> close(int handle) async {
  final JRpcRequest closeRequest = JRpcRequest(
      id: _getJsonRpcId(), method: 'close', params: Params(handle: handle));

  try {
    await sendRequest(closeRequest);
    return SktErrors.ESKT_NOERROR;
  } on CaptureException {
    rethrow;
  } catch (e) {
    throw CaptureException(SktErrors.ESKT_UNABLEDEINITIALIZE,
        'The object cannot be un-initialized', e.toString());
  }
}