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
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
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}>"