C# Class CoAP.Request

This class describes the functionality of a CoAP Request as a subclass of a CoAP Message. It provides: 1. operations to answer a request by a response using respond() 2. different ways to handle incoming responses: receiveResponse() or Responsed event
Inheritance: Message
Exibir arquivo Open project: smeshlink/CoAP.NET Class Usage Examples

Public Methods

Method Description
GetParameter ( String name ) : String

Gets the value of a query parameter as a String, or null if the parameter does not exist.

MarkObserve ( ) : Request

Sets CoAP's observe option. If the target resource of this request responds with a success code and also sets the observe option, it will send more responses in the future whenever the resource's state changes.

MarkObserveCancel ( ) : Request

Sets CoAP's observe option to the value of 1 to proactively cancel.

NewDelete ( ) : Request

Construct a DELETE request.

NewGet ( ) : Request

Construct a GET request.

NewPost ( ) : Request

Construct a POST request.

NewPut ( ) : Request

Construct a PUT request.

Request ( Method method ) : System

Initializes a request message.

Request ( Method method, System.Boolean confirmable ) : System

Initializes a request message.

Send ( ) : Request

Sends this message.

Send ( IEndPoint endpoint ) : Request

Sends the request over the specified endpoint.

SetUri ( String uri ) : Request
WaitForResponse ( ) : Response

Wait for a response.

WaitForResponse ( Int32 millisecondsTimeout ) : Response

Wait for a response.

Protected Methods

Method Description
OnCanceled ( ) : void
OnRejected ( ) : void
OnTimedOut ( ) : void

Private Methods

Method Description
CopyEventHandler ( Message src ) : void
Execute ( ) : void
FireReregister ( Request refresh ) : void
FireRespond ( Response response ) : void
FireResponding ( Response response ) : void
NotifyResponse ( ) : void
ValidateBeforeSending ( ) : void

Method Details

GetParameter() public method

Gets the value of a query parameter as a String, or null if the parameter does not exist.
public GetParameter ( String name ) : String
name String a String specifying the name of the parameter
return String

MarkObserve() public method

Sets CoAP's observe option. If the target resource of this request responds with a success code and also sets the observe option, it will send more responses in the future whenever the resource's state changes.
public MarkObserve ( ) : Request
return Request

MarkObserveCancel() public method

Sets CoAP's observe option to the value of 1 to proactively cancel.
public MarkObserveCancel ( ) : Request
return Request

NewDelete() public static method

Construct a DELETE request.
public static NewDelete ( ) : Request
return Request

NewGet() public static method

Construct a GET request.
public static NewGet ( ) : Request
return Request

NewPost() public static method

Construct a POST request.
public static NewPost ( ) : Request
return Request

NewPut() public static method

Construct a PUT request.
public static NewPut ( ) : Request
return Request

OnCanceled() protected method

protected OnCanceled ( ) : void
return void

OnRejected() protected method

protected OnRejected ( ) : void
return void

OnTimedOut() protected method

protected OnTimedOut ( ) : void
return void

Request() public method

Initializes a request message.
public Request ( Method method ) : System
method Method
return System

Request() public method

Initializes a request message.
public Request ( Method method, System.Boolean confirmable ) : System
method Method The method code of the message
confirmable System.Boolean True if the request is Confirmable
return System

Send() public method

Sends this message.
public Send ( ) : Request
return Request

Send() public method

Sends the request over the specified endpoint.
public Send ( IEndPoint endpoint ) : Request
endpoint IEndPoint
return Request

SetUri() public method

public SetUri ( String uri ) : Request
uri String
return Request

WaitForResponse() public method

Wait for a response.
public WaitForResponse ( ) : Response
return Response

WaitForResponse() public method

Wait for a response.
public WaitForResponse ( Int32 millisecondsTimeout ) : Response
millisecondsTimeout System.Int32 the maximum time to wait in milliseconds
return Response