[Gambas-user] Trouble writing to Accepted Socket stream
Cedron Dawg
cedron at exede.net
Sat Mar 30 03:52:28 CET 2019
Thank you for that most reasonable explanation.
I tried compiling the code (my modified T. Lee Davidson) and running it in a terminal. That worked fine. Then I opened a different terminal and telneted in. Ctrl-C does not kill that process. Ctrl-Cing in the sever console did. The real strangeness came when I opened up two different telnet consoles and telnetted in. Somehow, an infinite loop got started and the server window just spewed response after response.
I will test further to see if I can duplicate that.
I did my fair share of kill -9 #### back in the day.
----- Original Message -----
From: "adamnt42" <adamnt42 at gmail.com>
To: "user" <user at lists.gambas-basic.org>
Sent: Friday, March 29, 2019 10:42:19 PM
Subject: Re: [Gambas-user] Trouble writing to Accepted Socket stream
Have a look at http://gambaswiki.org/wiki/comp/gb.signal
From that, it looks like the IDE is catching a SIGTERM sent from the
telnet process (or the terminal emulator in which the telnet process is
running, your guess is as good as mine), which is not being handled in
your running "server" process. So the parent process (the IDE) is
terminating.
BTW, IMO the IDE should terminate given a SIGTERM! I can recall many
instances where I have needed to "kill" a runaway process running inside
the IDE. Mainly when I have got it into an endless loop that does not
invoke the event loop, so the only way to interrupt it is to kill the
parent process.
I reckon if you handle the SIGTERM (or whatever signal is being sent
from the telnet/terminal emulator session) using the gb.signal component
then you would be able to handle it as you desire.
b
More information about the User
mailing list