when a large file Download was stoped the Server exited with SIGPIPE - fixed

This commit is contained in:
René Linder 2022-02-17 13:19:46 +01:00
parent 2ce4902b39
commit 7c9a610f47
1 changed files with 12 additions and 1 deletions

View File

@ -13,6 +13,17 @@ CompilerIf #PB_Compiler_OS <> #PB_OS_Linux
CompilerError "Only for Linux"
CompilerEndIf
;***********************
;* The SIGPIPE Signal must be Handled Inside / Ignored
#SIGPIPE = 13
Procedure SignalIgnore()
Debug("Signal Ignore")
EndProcedure
;***********************
signal_(#SIGPIPE, @SignalIgnore());
DeclareModule lsocket
Structure sockaddr
sa_family.w
@ -57,7 +68,7 @@ EndDeclareModule
Module lsocket
Global NewMap lsockets_server.sockaddr_in()
Global NewMap lsockets_client.sockaddr_in()
Procedure CreateSocket(Port.i, Queuelengt.i = 64, Type.i = #SOCK_STREAM, Protocol.i = #AF_INET, BindedIP.s = "127.0.0.1") ; Return Server Socket < 0 Error
Protected SocketID.i
SocketID = socket_(Protocol, Type, 0)