NBMJSONRPCClient Class Reference
Inherits from | NSObject |
---|---|
Declared in | NBMJSONRPCClient.h |
configuration
The client configuration object.
@property (nonatomic, readonly) NBMJSONRPCClientConfiguration *configuration
Declared In
NBMJSONRPCClient.h
delegate
The delegate object for the client.
@property (nonatomic, weak) id<NBMJSONRPCClientDelegate> delegate
Declared In
NBMJSONRPCClient.h
connected
A boolean that indicates the websocket connection status.
@property (nonatomic, readonly, getter=isConnected) BOOL connected
Declared In
NBMJSONRPCClient.h
– initWithURL:delegate:
Creates and initializes a JSON-RPC client with the specified endpoint using default configuration.
- (instancetype)initWithURL:(NSURL *)url delegate:(id<NBMJSONRPCClientDelegate>)delegate
Parameters
url |
The endpoint URL. |
---|---|
delegate |
The delegate object for the client. |
Return Value
An initialized JSON-RPC client.
Declared In
NBMJSONRPCClient.h
– initWithURL:configuration:delegate:
Creates and initializes a JSON-RPC client with the specified endpoint using provided configuration.
- (instancetype)initWithURL:(NSURL *)url configuration:(NBMJSONRPCClientConfiguration *)configuration delegate:(id<NBMJSONRPCClientDelegate>)delegate
Parameters
url |
The endpoint URL. |
---|---|
configuration |
A configuration object. |
delegate |
The delegate object for the client. |
Return Value
An initialized JSON-RPC client.
Declared In
NBMJSONRPCClient.h
– connect
Connects client to the server using WebSocket.
- (void)connect
Discussion
Note: Use this method after initialization when
Declared In
NBMJSONRPCClient.h
– sendRequestWithMethod:completion:
Creates and sends a request with the specified method using websocket as transport channel.
- (NBMRequest *)sendRequestWithMethod:(NSString *)method completion:(void ( ^ ) ( NBMResponse *response ))responseBlock
Parameters
method |
The request method. Must not be |
---|---|
responseBlock |
A block object to be executed when the request is sent. This block has no return value and takes the response object created by the client
response serializer. The response object may be |
Return Value
The NBMRequest
object that was sent.
Declared In
NBMJSONRPCClient.h
– sendRequestWithMethod:parameters:completion:
Creates and sends a request with the specified method and parameters using websocket as transport channel.
- (NBMRequest *)sendRequestWithMethod:(NSString *)method parameters:(id)parameters completion:(void ( ^ ) ( NBMResponse *response ))responseBlock
Parameters
method |
The request method. Musto not be |
---|---|
parameters |
The parameters to encode into the request. Must be either an |
responseBlock |
A block object to be executed when the request is sent. This block has no return value and takes the response object created by the client.
response serializer. The response object may be |
Return Value
The NBMRequest
object that was sent.
Declared In
NBMJSONRPCClient.h
– sendRequest:completion:
Sends a provided request using websocket as transport channel.
- (void)sendRequest:(NBMRequest *)requestToSend completion:(void ( ^ ) ( NBMResponse *response ))responseBlock
Parameters
requestToSend |
The |
---|---|
responseBlock |
A block object to be executed when the request is sent. This block has no return value and takes the response object created by the client
response serializer. The response object may be |
Declared In
NBMJSONRPCClient.h
– sendNotificationWithMethod:parameters:
Creates and sends a notification with the specified method and parameters using websocket as transport channel.
- (NBMRequest *)sendNotificationWithMethod:(NSString *)method parameters:(id)parameters
Parameters
method |
The notification method. Must not be |
---|---|
parameters |
The parameters to encode into the notification. Must be either an |
Return Value
The NBMRequest
object that was sent.
Discussion
Note: Notification is a NBMRequest
object that produces no server response.
Declared In
NBMJSONRPCClient.h
– sendNotification:
Sends a provided notification using websocket as transport channel.
- (void)sendNotification:(NBMRequest *)notification
Parameters
notification |
The |
---|
Declared In
NBMJSONRPCClient.h
– cancelRequest:
Allow to cancel a request and don’t wait for a response.
- (void)cancelRequest:(NBMRequest *)request
Parameters
request |
The |
---|
Declared In
NBMJSONRPCClient.h
– cancelAllRequest
Allow to cancel all requests and don’t wait for responses.
- (void)cancelAllRequest
Declared In
NBMJSONRPCClient.h