blob: 6d3feb1785f7a359aad6d88fe605d25afc359ed3 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#ifndef AOS_NETWORK_SEND_SOCKET_H_
2#define AOS_NETWORK_SEND_SOCKET_H_
3
4#include "Socket.h"
5
6namespace aos {
7
8class SendSocket : public Socket {
9 public:
10 //inline int Send(const void *buf, int length) { return Socket::Send(buf, length); }
11 // Connect must be called before use.
12 SendSocket() {}
13 // Calls Connect automatically.
14 SendSocket(NetworkPort port, const char *robot_ip) {
15 Connect(port, robot_ip);
16 }
17 int Connect(NetworkPort port, const char *robot_ip, int type = SOCK_DGRAM);
18
19 static const size_t MAX_MSG = 4096;
20 char hold_msg_[MAX_MSG];
21 size_t hold_msg_len_;
22 int SendHoldMsg();
23};
24
25} // namespace aos
26
27#endif
28