Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: mojo/services/public/interfaces/network/udp_socket.mojom

Issue 668993002: Mojo UDP: add a client-side wrapper which handles the client<->server buffering for users. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/services/public/cpp/network/udp_socket_wrapper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import "mojo/services/public/interfaces/network/net_address.mojom" 5 import "mojo/services/public/interfaces/network/net_address.mojom"
6 import "mojo/services/public/interfaces/network/network_error.mojom" 6 import "mojo/services/public/interfaces/network/network_error.mojom"
7 7
8 module mojo { 8 module mojo {
9 9
10 // UDPSocket and UDPSocketClient represent a UDP socket and its client. The 10 // UDPSocket and UDPSocketClient represent a UDP socket and its client. The
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // requests directly with error code ERR_INSUFFICIENT_RESOURCES and discards 47 // requests directly with error code ERR_INSUFFICIENT_RESOURCES and discards
48 // those datagrams. If the client wants to avoid such failures, it needs to 48 // those datagrams. If the client wants to avoid such failures, it needs to
49 // keep track of how many SendTo() calls are pending and make sure the number 49 // keep track of how many SendTo() calls are pending and make sure the number
50 // doesn't exceed the result of this method. 50 // doesn't exceed the result of this method.
51 NegotiateMaxPendingSendRequests(uint32 requested_size) 51 NegotiateMaxPendingSendRequests(uint32 requested_size)
52 => (uint32 actual_size); 52 => (uint32 actual_size);
53 53
54 // Notifies that the client is ready to accept |number| of datagrams. 54 // Notifies that the client is ready to accept |number| of datagrams.
55 // Correspondingly, OnReceived() of the UDPSocketClient interface will be 55 // Correspondingly, OnReceived() of the UDPSocketClient interface will be
56 // called |number| times (errors also count), unless the connection is closed 56 // called |number| times (errors also count), unless the connection is closed
57 // before that. The socket must be bound. 57 // before that.
58 // 58 //
59 // It is allowed to call this method again before the previous request is 59 // It is allowed to call this method again before the previous request is
60 // completely satisfied. For example: 60 // completely satisfied. For example:
61 // service->ReceiveMore(3); 61 // service->ReceiveMore(3);
62 // ... 62 // ...
63 // // OnReceived() is called. 63 // // OnReceived() is called.
64 // // OnReceived() is called. 64 // // OnReceived() is called.
65 // ... 65 // ...
66 // service->ReceiveMore(3); 66 // service->ReceiveMore(3);
67 // // The client expects 4 more calls to OnReceived(). 67 // // The client expects 4 more calls to OnReceived().
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 }; 99 };
100 100
101 interface UDPSocketClient { 101 interface UDPSocketClient {
102 // On success, |src_addr| and |data| are non-NULL, and |result.code| is a 102 // On success, |src_addr| and |data| are non-NULL, and |result.code| is a
103 // non-negative number indicating how many bytes have been received. On 103 // non-negative number indicating how many bytes have been received. On
104 // failure, |result.code| is a network error code. 104 // failure, |result.code| is a network error code.
105 OnReceived(NetworkError result, NetAddress? src_addr, array<uint8>? data); 105 OnReceived(NetworkError result, NetAddress? src_addr, array<uint8>? data);
106 }; 106 };
107 107
108 } 108 }
OLDNEW
« no previous file with comments | « mojo/services/public/cpp/network/udp_socket_wrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698