blob: 27021e0576b87038643c7efdb904c45dfa01a2c1 [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:
brians343bc112013-02-10 01:53:46 +000010 // Connect must be called before use.
11 SendSocket() {}
12 // Calls Connect automatically.
Brian Silvermana9cbe302013-03-12 18:41:44 -070013 SendSocket(NetworkPort port, const char *robot_ip) {
brians343bc112013-02-10 01:53:46 +000014 Connect(port, robot_ip);
15 }
Brian Silvermana9cbe302013-03-12 18:41:44 -070016 int Connect(NetworkPort port, const char *robot_ip, int type = SOCK_DGRAM);
brians343bc112013-02-10 01:53:46 +000017
18 static const size_t MAX_MSG = 4096;
Brian Silvermana9cbe302013-03-12 18:41:44 -070019 char hold_msg_[MAX_MSG];
20 size_t hold_msg_len_;
21 int SendHoldMsg();
brians343bc112013-02-10 01:53:46 +000022};
23
24} // namespace aos
25
26#endif
27