Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
child process always terminate when the main process exits normally or unexpectedly?
#1
The video below demonstrates the operation of the main process TcpSocket and the child process frpc.

The issue is that when the main process TcpSocket exits, either normally or unexpectedly, the child process frpc continues to run. How can I ensure it terminates?

I’ve been stuck on this issue for a long time. Thanks in advance for any suggestions or help!

https://github.com/xhzkp/temp_video/issues/5

Function TcpServer_Frpc
Code:
Copy      Help
out
if(getopt(nthreads)>1) ret ;;allow single instance
AddTrayIcon "cut.ico" "test_TcpSocket_server[]Ctrl+click to end."

out mac("sub.frpcExc")

#compile "__TcpSocket"
TcpSocket x.ServerStart(5032 &sub.OnClientConnected)

#sub OnClientConnected
function TcpSocket&client $clientIp param !*reserved

client.Receive(_s 1000)
out F"SERVER: client request: {_s}"

client.Send("response 1")

#sub frpcExc
str curDir="$desktop$\Frpc"


int ec=RunConsoleCallback(&sub.OnConsoleOutput 0 "frpc.exe -c frpc.toml" curDir 0x4801)
out ec

#sub OnConsoleOutput
function# cbParam $s
out F"<{s}>"


Messages In This Thread
child process always terminate when the main process exits normally or unexpectedly? - by Davider - 12-21-2024, 08:46 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)