|
a/src/utils/netcon.cpp |
|
b/src/utils/netcon.cpp |
|
... |
|
... |
17 |
|
17 |
|
18 |
// Wrapper classes for the socket interface
|
18 |
// Wrapper classes for the socket interface
|
19 |
|
19 |
|
20 |
|
20 |
|
21 |
#ifndef TEST_NETCON
|
21 |
#ifndef TEST_NETCON
|
|
|
22 |
#include "autoconfig.h"
|
|
|
23 |
|
22 |
#include <stdio.h>
|
24 |
#include <stdio.h>
|
23 |
#include <stdlib.h>
|
25 |
#include <stdlib.h>
|
24 |
#include <string.h>
|
26 |
#include <string.h>
|
25 |
#include <errno.h>
|
27 |
#include <errno.h>
|
26 |
|
28 |
|
|
... |
|
... |
1228 |
} else {
|
1230 |
} else {
|
1229 |
sleep(1);
|
1231 |
sleep(1);
|
1230 |
}
|
1232 |
}
|
1231 |
}
|
1233 |
}
|
1232 |
#else
|
1234 |
#else
|
1233 |
RefCntr<NetconWorker> worker =
|
1235 |
STD_SHARED_PTR<NetconWorker> worker =
|
1234 |
RefCntr<NetconWorker>(new CliNetconWorker());
|
1236 |
STD_SHARED_PTR<NetconWorker>(new CliNetconWorker());
|
1235 |
clicon->setcallback(worker);
|
1237 |
clicon->setcallback(worker);
|
1236 |
SelectLoop myloop;
|
1238 |
SelectLoop myloop;
|
1237 |
myloop.addselcon(con, Netcon::NETCONPOLL_WRITE);
|
1239 |
myloop.addselcon(con, Netcon::NETCONPOLL_WRITE);
|
1238 |
fprintf(stderr, "client ready\n");
|
1240 |
fprintf(stderr, "client ready\n");
|
1239 |
ret = myloop.doLoop();
|
1241 |
ret = myloop.doLoop();
|
|
... |
|
... |
1294 |
int cando(Netcon::Event reason) {
|
1296 |
int cando(Netcon::Event reason) {
|
1295 |
NetconServCon *con = accept();
|
1297 |
NetconServCon *con = accept();
|
1296 |
if (con == 0) {
|
1298 |
if (con == 0) {
|
1297 |
return -1;
|
1299 |
return -1;
|
1298 |
}
|
1300 |
}
|
1299 |
RefCntr<NetconWorker> worker =
|
1301 |
STD_SHARED_PTR<NetconWorker> worker =
|
1300 |
RefCntr<NetconWorker>(new ServNetconWorker());
|
1302 |
STD_SHARED_PTR<NetconWorker>(new ServNetconWorker());
|
1301 |
con->setcallback(worker);
|
1303 |
con->setcallback(worker);
|
1302 |
m_loop.addselcon(NetconP(con), NETCONPOLL_READ);
|
1304 |
m_loop.addselcon(NetconP(con), NETCONPOLL_READ);
|
1303 |
return 1;
|
1305 |
return 1;
|
1304 |
}
|
1306 |
}
|
1305 |
SelectLoop& m_loop;
|
1307 |
SelectLoop& m_loop;
|