コード例 #1
0
        public void SendServiceExternalError()
        {
            if (connection == null)
            {
                throw new InvalidOperationException("Access denied!");
            }

            if (id == ServiceProtocolDataContract.RequestIdWithoutResponse)
            {
                throw new InvalidOperationException("This request is not associated with any response!");
            }

            connection.Send(id, new ServiceProtocolInternalResponse {
                Code = ServiceProtocolResponseCode.RemoteServiceExternalError
            });
            connection = null;
        }
コード例 #2
0
        public void SendResponse(ServiceProtocolResponse response)
        {
            if (response == null)
            {
                throw new ArgumentNullException(nameof(response));
            }

            if (connection == null)
            {
                throw new InvalidOperationException("Access denied!");
            }

            if (id == ServiceProtocolDataContract.RequestIdWithoutResponse)
            {
                throw new InvalidOperationException("This request is not associated with any response!");
            }

            connection.Send(id, response);
            connection = null;
        }