summaryrefslogtreecommitdiff
path: root/node/SocketManager.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'node/SocketManager.hpp')
-rw-r--r--node/SocketManager.hpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/node/SocketManager.hpp b/node/SocketManager.hpp
index 003c35eb..40a0c1df 100644
--- a/node/SocketManager.hpp
+++ b/node/SocketManager.hpp
@@ -85,17 +85,22 @@ public:
/**
* Send a message to a remote peer
*
- * If 'tcp' is true an existing TCP socket will be used or an attempt will
- * be made to connect if one is not available. The message will be placed
- * in the connecting TCP socket's outgoing queue, so if the connection
- * succeeds the message will be sent. Otherwise it will be dropped.
- *
* @param to Destination address
* @param tcp Use TCP?
+ * @param autoConnectTcp If true, automatically initiate TCP connection if there is none
+ * @param msg Message to send
+ * @param msglen Length of message
+ */
+ bool send(const InetAddress &to,bool tcp,bool autoConnectTcp,const void *msg,unsigned int msglen);
+
+ /**
+ * Send a message to a remote peer via UDP (shortcut for setting both TCP params to false in send)
+ *
+ * @param to Destination address
* @param msg Message to send
* @param msglen Length of message
*/
- bool send(const InetAddress &to,bool tcp,const void *msg,unsigned int msglen);
+ inline bool sendUdp(const InetAddress &to,const void *msg,unsigned int msglen) { return send(to,false,false,msg,msglen); }
/**
* Send a UDP packet with a limited IP TTL