author | viric@llimona |
Sun, 17 Feb 2008 22:27:55 +0100 | |
changeset 88 | a7f546938313 |
parent 66 | b2469563a1dc |
permissions | -rw-r--r-- |
66
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
1 |
/* |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
2 |
Terminal Mixer - multi-point multi-user access to terminal applications |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
3 |
Copyright (C) 2007 LluĂs Batlle i Rossell |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
4 |
|
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
5 |
Please find the license in the provided COPYING file. |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
6 |
*/ |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
7 |
#include <stdlib.h> |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
8 |
#include <unistd.h> |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
9 |
#include <sys/select.h> |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
10 |
|
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
11 |
#include "main.h" |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
12 |
#include "handlers.h" |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
13 |
|
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
14 |
void avoid_sending(fd_set *read_set) |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
15 |
{ |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
16 |
dump_line("Avoid sending\n"); |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
17 |
if (command_line.is_server) |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
18 |
{ |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
19 |
if (app_stdout >= 0) |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
20 |
FD_CLR(app_stdout, read_set); |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
21 |
if (app_stderr >= 0) |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
22 |
FD_CLR(app_stderr, read_set); |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
23 |
} |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
24 |
else |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
25 |
{ |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
26 |
FD_CLR(0, read_set); /* client terminal stdin */ |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
27 |
} |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff
changeset
|
28 |
} |