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
Afficher le fichier Open project: smeshlink/CoAP.NET Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
OnCanceled ( ) : void
OnRejected ( ) : void
OnTimedOut ( ) : void

Private Methods

Méthode 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 méthode

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
Résultat String

MarkObserve() public méthode

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
Résultat Request

MarkObserveCancel() public méthode

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

NewDelete() public static méthode

Construct a DELETE request.
public static NewDelete ( ) : Request
Résultat Request

NewGet() public static méthode

Construct a GET request.
public static NewGet ( ) : Request
Résultat Request

NewPost() public static méthode

Construct a POST request.
public static NewPost ( ) : Request
Résultat Request

NewPut() public static méthode

Construct a PUT request.
public static NewPut ( ) : Request
Résultat Request

OnCanceled() protected méthode

protected OnCanceled ( ) : void
Résultat void

OnRejected() protected méthode

protected OnRejected ( ) : void
Résultat void

OnTimedOut() protected méthode

protected OnTimedOut ( ) : void
Résultat void

Request() public méthode

Initializes a request message.
public Request ( Method method ) : System
method Method
Résultat System

Request() public méthode

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
Résultat System

Send() public méthode

Sends this message.
public Send ( ) : Request
Résultat Request

Send() public méthode

Sends the request over the specified endpoint.
public Send ( IEndPoint endpoint ) : Request
endpoint IEndPoint
Résultat Request

SetUri() public méthode

public SetUri ( String uri ) : Request
uri String
Résultat Request

WaitForResponse() public méthode

Wait for a response.
public WaitForResponse ( ) : Response
Résultat Response

WaitForResponse() public méthode

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