I work in an embedded Linux environment.
it starts the telnet daemon at startup, which monitors a specific port and runs the program when it receives a connection.
i.e.
telnetd -l /usr/local/bin/PROGA -p 1234
PROGA - displays some data at irregular intervals. When it does not output data, each X-period of time sends a line of the "heartbeat" type so that the client knows that we are still active, i.e. "Heartbeat \ r \ n"
After a random amount of time, the client (use the Linux version of telnet launched with:, telnet xxx.xxx.xxx.xxx 1234)will not get "heartbeat \ r \ n"
The data that the client sees:
heartbeat
heartbeat
heartbeat
...
heartbeat
[nothing, should have received heartbeat]
[nothing forever]
heartbeat sent:
result = printf("%s", heartbeat);
heartbeat. syslog , printf()
tcdrain fflush, , , , .
.
** UDPATE: wirehark . , . Hicups, . - . (telnet Ubuntu 9.04), , ( ). Wireshark , . , , ( ), , ( ). Wireshark .
, , . /? (\ r\n) .
** 2: netcat telnetd, .