Compare commits
4 Commits
v0.0.33-mu
...
v0.0.37-mu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99262777fc | ||
|
|
b0f60caab2 | ||
|
|
efd5e0bb36 | ||
|
|
ade4617d53 |
2
mud
2
mud
Submodule mud updated: ecec237a56...3b86683636
20
src/main.c
20
src/main.c
@@ -242,9 +242,6 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
gt.timeout = 5000;
|
gt.timeout = 5000;
|
||||||
|
|
||||||
long down_timeout = 0;
|
|
||||||
long send_timeout = 0;
|
|
||||||
long pong_timeout = 0;
|
|
||||||
long time_tolerance = 0;
|
long time_tolerance = 0;
|
||||||
|
|
||||||
struct option opts[] = {
|
struct option opts[] = {
|
||||||
@@ -257,9 +254,6 @@ int main (int argc, char **argv)
|
|||||||
{ "multiqueue", NULL, option_option },
|
{ "multiqueue", NULL, option_option },
|
||||||
{ "statefile", &statefile, option_str },
|
{ "statefile", &statefile, option_str },
|
||||||
{ "timeout", >.timeout, option_long },
|
{ "timeout", >.timeout, option_long },
|
||||||
{ "down-timeout", &down_timeout, option_long },
|
|
||||||
{ "send-timeout", &send_timeout, option_long },
|
|
||||||
{ "pong-timeout", &pong_timeout, option_long },
|
|
||||||
{ "time-tolerance", &time_tolerance, option_long },
|
{ "time-tolerance", &time_tolerance, option_long },
|
||||||
{ "version", NULL, option_option },
|
{ "version", NULL, option_option },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
@@ -314,14 +308,7 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
mud_set_key(mud, gt.key, sizeof(gt.key));
|
mud_set_key(mud, gt.key, sizeof(gt.key));
|
||||||
|
|
||||||
if (down_timeout > 0)
|
mud_set_send_timeout_msec(mud, gt.timeout);
|
||||||
mud_set_down_timeout_msec(mud, down_timeout);
|
|
||||||
|
|
||||||
if (send_timeout > 0)
|
|
||||||
mud_set_send_timeout_msec(mud, send_timeout);
|
|
||||||
|
|
||||||
if (pong_timeout > 0)
|
|
||||||
mud_set_pong_timeout_msec(mud, pong_timeout);
|
|
||||||
|
|
||||||
if (time_tolerance > 0)
|
if (time_tolerance > 0)
|
||||||
mud_set_time_tolerance_sec(mud, time_tolerance);
|
mud_set_time_tolerance_sec(mud, time_tolerance);
|
||||||
@@ -371,9 +358,12 @@ int main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct timeval timeout = {
|
struct timeval timeout = {
|
||||||
.tv_usec = 1000,
|
.tv_usec = 100000,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (mud_can_push(mud))
|
||||||
|
timeout.tv_usec = 1000;
|
||||||
|
|
||||||
if _0_(select(mud_fd+1, &rfds, NULL, NULL, &timeout)==-1) {
|
if _0_(select(mud_fd+1, &rfds, NULL, NULL, &timeout)==-1) {
|
||||||
if (errno==EINTR)
|
if (errno==EINTR)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user