CreateRequestMessage() приватный Метод

private CreateRequestMessage ( string name, Newtonsoft.Json.Linq.JArray json, byte blob = null ) : Message
name string
json Newtonsoft.Json.Linq.JArray
blob byte
Результат Message
Пример #1
0
            public static async Task <CreateBlobRequest> CreateAsync(RHost host, CancellationToken cancellationToken)
            {
                var message = host.CreateRequestMessage("?CreateBlob", new JArray());
                var request = new CreateBlobRequest(host, message, cancellationToken);

                await host.SendAsync(message, cancellationToken);

                return(request);
            }
Пример #2
0
            public static async Task <BlobSizeRequest> SetSizeAsync(RHost host, ulong blobId, long size, CancellationToken cancellationToken)
            {
                var message = host.CreateRequestMessage("?SetBlobSize", new JArray {
                    blobId, size
                });
                var request = new BlobSizeRequest(host, message, cancellationToken);
                await host.SendAsync(message, cancellationToken);

                return(request);
            }
Пример #3
0
            public static async Task <BlobReadRequest> ReadAsync(RHost host, ulong blobId, long position, long count, CancellationToken cancellationToken)
            {
                var message = host.CreateRequestMessage("?ReadBlob", new JArray {
                    blobId, position, count
                });
                var request = new BlobReadRequest(host, message, cancellationToken);
                await host.SendAsync(message, cancellationToken);

                return(request);
            }
Пример #4
0
            /// <summary>
            /// Appends data to the end of the blob
            /// </summary>
            public static async Task <BlobWriteRequest> WriteAsync(RHost host, ulong blobId, byte[] data, long position, CancellationToken cancellationToken)
            {
                var message = host.CreateRequestMessage("?WriteBlob", new JArray {
                    blobId, position
                }, data);
                var request = new BlobWriteRequest(host, message, cancellationToken);
                await host.SendAsync(message, cancellationToken);

                return(request);
            }