15 int main(int argc
, char * argv
[])
18 char * host
= "127.0.0.1";
20 struct termios ti1
, ti2
;
23 int already_requested
= 0;
32 fd
= vncproto_init(host
, port
);
40 if (request_vnc_refresh(fd
) == -1)
42 tcsetattr(0, TCSANOW
, &ti2
);
51 retval
= select(fd
+1, &sel_in
, NULL
, NULL
, &tv
);
53 if (!already_requested
&& !must_redraw
&& !must_draw
) {
54 if (request_vnc_refresh(fd
) == -1)
56 already_requested
= 1;
58 if (must_draw
|| must_redraw
) {
59 must_draw
= drawdelta();
61 must_draw
=must_redraw
;
71 if (FD_ISSET(fd
, &sel_in
)) {
72 already_requested
= 0;
73 if (parse_vnc_in(fd
) == -1)
79 if (FD_ISSET(0, &sel_in
)) {
80 if (parse_kbd_in(0, fd
) == -1)
85 tcsetattr(0, TCSANOW
, &ti1
);
86 #define W(a,b) write((a),(b),strlen(b))