Coap.Proxy.ClientConnection.PerformCoAP C# (CSharp) Method

PerformCoAP() private method

private PerformCoAP ( Request method, Uri uri, System.Boolean messageVisible, System.Boolean observe ) : Request
method Request
uri System.Uri
messageVisible System.Boolean
observe System.Boolean
return Request
        private Request PerformCoAP(Request.Method method, Uri uri, Boolean messageVisible, Boolean observe)
        {

            if (null != _currentRequest)
                _currentRequest.Cancel();

            Request request = Request.Create(method);
            _currentRequest = request;
            request.URI = uri;

            if (method == Request.Method.POST || method == Request.Method.PUT)
            {
                request.SetPayload(this.Payload, MediaType.TextPlain);
            }
            if (messageVisible)
            {
                request.Responding += new EventHandler<ResponseEventArgs>(request_Responding);
                request.Responded += new EventHandler<ResponseEventArgs>(request_Responded);
            }
            request.ResponseQueueEnabled = true;
            request.Execute();
            return request;
        }