|
|
@ -121,11 +121,12 @@ MainWindow::~MainWindow() { delete ui; } |
|
|
|
void MainWindow::mainWindowsRun() { //
|
|
|
|
XSyncUdpFactoryImpl::Ins()->initialize(); |
|
|
|
|
|
|
|
auto xsudp = XSyncUdpFactoryImpl::Ins()->createXSUDP(); |
|
|
|
XS_ASSERT(xsudp->initialize("0.0.0.0", 9999)); |
|
|
|
xsudp->startReceive([this, xsudp](XsyncNetAdd &from, uint8_t *data, size_t length) { |
|
|
|
ZLOGI(TAG, "receive from <%s:%d> (%d) :%s", from.ip.c_str(), from.port, data, length); |
|
|
|
xsudp->sendto(from, "hello\n", 5, NULL); |
|
|
|
}); |
|
|
|
|
|
|
|
// auto xsudp = XSyncUdpFactoryImpl::Ins()->createXSUDP();
|
|
|
|
// XS_ASSERT(xsudp->initialize("0.0.0.0", 9999));
|
|
|
|
// xsudp->startReceive([this, xsudp](XsyncNetAdd &from, uint8_t *data, size_t length) {
|
|
|
|
// ZLOGI(TAG, "receive from <%s:%d> (%d) :%s", from.ip.c_str(), from.port, data, length);
|
|
|
|
// xsudp->sendto(from, "hello\n", 5, NULL);
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
} |