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

Unified Diff: mojo/services/network/public/cpp/udp_socket_wrapper.h

Issue 863023004: Mojo UDP socket: support connected mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/services/network/public/cpp/udp_socket_wrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/public/cpp/udp_socket_wrapper.h
diff --git a/mojo/services/network/public/cpp/udp_socket_wrapper.h b/mojo/services/network/public/cpp/udp_socket_wrapper.h
index 32204d7cb3fe4764ab9115eccaa95ec62096575c..650f98e411cd5d1e21decd658e2188799f8fdf2c 100644
--- a/mojo/services/network/public/cpp/udp_socket_wrapper.h
+++ b/mojo/services/network/public/cpp/udp_socket_wrapper.h
@@ -43,6 +43,9 @@ class UDPSocketWrapper : public UDPSocketClient {
void Bind(NetAddressPtr addr,
const Callback<void(NetworkErrorPtr, NetAddressPtr)>& callback);
+ void Connect(NetAddressPtr remote_addr,
+ const Callback<void(NetworkErrorPtr, NetAddressPtr)>& callback);
jamesr 2015/01/22 00:32:37 we really should generate typedefs for these callb
yzshen1 2015/01/22 00:38:58 Yeah. That should be pretty easy. I will put it in
+
void SetSendBufferSize(uint32_t size, const ErrorCallback& callback);
void SetReceiveBufferSize(uint32_t size, const ErrorCallback& callback);
@@ -51,10 +54,13 @@ class UDPSocketWrapper : public UDPSocketClient {
// |callback| before it returns, and the return value is set to true.
// Otherwise, the return value is set to false and the callback will be run
// asynchronously.
+ // If the socket is connected, the net address pointer passed into the
+ // callback is set to null.
bool ReceiveFrom(const ReceiveCallback& callback);
// This method is aware of the max pending send requests allowed by the
// service, and caches send requests locally if necessary.
+ // |dest_addr| is allowed to be null if the socket is connected.
void SendTo(NetAddressPtr dest_addr,
Array<uint8_t> data,
const ErrorCallback& callback);
« no previous file with comments | « no previous file | mojo/services/network/public/cpp/udp_socket_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698