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 { class XsyncNetAdd {
public: public:
uint32_t ip;
XsyncNetAdd(){};
XsyncNetAdd(string ip, uint32_t port) : ip(ip), port(port) {}
string ip;
uint32_t port; uint32_t port;
}; };
@ -62,8 +64,10 @@ class I_XSUDP {
* @param data * @param data
* @param length * @param length
* @return int * @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消息 * @brief UDP消息
* *
@ -71,8 +75,10 @@ class I_XSUDP {
* @param length * @param length
* @param from * @param from
* @return int * @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() {} virtual ~I_XSUDP() {}
}; };

Loading…
Cancel
Save