Browse Source

update

xsync_v2
zhaohe 2 years ago
parent
commit
33e27f52d3
  1. 12
      xsync.hpp

12
xsync.hpp

@ -24,7 +24,9 @@ typedef enum {
class XsyncNetAdd {
public:
uint32_t ip;
XsyncNetAdd(){};
XsyncNetAdd(string ip, uint32_t port) : ip(ip), port(port) {}
string ip;
uint32_t port;
};
@ -62,8 +64,10 @@ class I_XSUDP {
* @param data
* @param length
* @return int
* >0 ,
* <0
*/
virtual xs_error_code_t sendto(const XsyncNetAdd& to, const char* data, int32_t length) = 0;
virtual xs_error_code_t sendto(const XsyncNetAdd& to, const char* data, int32_t length, int32_t* sendlength) = 0;
/**
* @brief UDP消息
*
@ -71,8 +75,10 @@ class I_XSUDP {
* @param length
* @param from
* @return int
* >0 ,
* <0
*/
virtual xs_error_code_t receive(const char* data, int32_t length, XsyncNetAdd& from, int overtimems) = 0;
virtual xs_error_code_t receive(char* data, int32_t& length, XsyncNetAdd& from, int overtimems) = 0;
virtual ~I_XSUDP() {}
};

Loading…
Cancel
Save