82 timeout.tv_sec = 0; |
82 timeout.tv_sec = 0; |
83 timeout.tv_usec = 250000; // 0.25 seconds |
83 timeout.tv_usec = 250000; // 0.25 seconds |
84 FD_ZERO (&fdset); |
84 FD_ZERO (&fdset); |
85 FD_SET (0, &fdset); |
85 FD_SET (0, &fdset); |
86 |
86 |
87 int fd = iface.get_session()->socket()->file_descriptor(); |
87 int fd = iface.getSession()->socket()->file_descriptor(); |
88 highest = zfc::max (highest, fd); |
88 highest = zfc::max (highest, fd); |
89 FD_SET (fd, &fdset); |
89 FD_SET (fd, &fdset); |
90 |
90 |
91 select (highest + 1, &fdset, nullptr, nullptr, &timeout); |
91 select (highest + 1, &fdset, nullptr, nullptr, &timeout); |
92 |
92 |
93 if (FD_ISSET (0, &fdset)) |
93 if (FD_ISSET (0, &fdset)) |
94 { |
94 { |
95 // stdin is ready, what's incoming? |
95 // stdin is ready, what's incoming? |
96 iface.handle_input(); |
96 iface.handleInput(); |
97 } |
97 } |
98 |
98 |
99 iface.get_session()->tick(); |
99 iface.getSession()->tick(); |
100 iface.render(); |
100 iface.render(); |
101 } |
101 } |
102 } |
102 } |
103 catch (const zfc::Exitception&) {} |
103 catch (const zfc::Exitception&) {} |
104 |
104 |
105 iface.get_session()->disconnect(); |
105 iface.getSession()->disconnect(); |
106 return EXIT_SUCCESS; |
106 return EXIT_SUCCESS; |
107 } |
107 } |