diff --git a/NET/lhs_net_socket.pbi b/NET/lhs_net_socket.pbi index 34a0498..259597d 100644 --- a/NET/lhs_net_socket.pbi +++ b/NET/lhs_net_socket.pbi @@ -12,7 +12,7 @@ CompilerIf #PB_Compiler_OS <> #PB_OS_Linux CompilerError "Only for Linux" CompilerEndIf - +XIncludeFile "../SYS/lhs_sys_debug_wrapper.pbi" ;*********************** ;* The SIGPIPE Signal must be Handled Inside / Ignored #SIGPIPE = 13 @@ -57,6 +57,11 @@ DeclareModule lsocket #PF_INET = 2 #AF_INET = #PF_INET + Global LoggerUUID.s = "" + Global Log_Level_Info = 0 + Global Log_Level_Debug = 0 + Global Log_Level_Error = 2 + Declare 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 Declare WaitSocket(ServerSocket.i) ;Return new SocketID Declare ReadSocket(ClientSocket.i, *Buffer, Length.i) ;Return Effective Read @@ -97,7 +102,7 @@ Module lsocket Else IPAddresse = PeekS(Inet_ntoa_(lsockets_client(Str(Socket))\sin_addr\s_addr), -1, #PB_Ascii) EndIf - Debug "Requested IP Information:" + IPAddresse + ldl::Logging("Requested IP Information:" + IPAddresse, LoggerUUID, Log_Level_Info) ProcedureReturn IPAddresse EndProcedure @@ -110,7 +115,7 @@ Module lsocket If ClientSID < 0 : FreeMemory(memory) : ProcedureReturn ClientSID : EndIf MapID = Str(ClientSID) CopyMemory(memory, lsockets_client(MapID), ClientLength) - Debug "Connected IP:" + PeekS(Inet_ntoa_(lsockets_client(MapID)\sin_addr\s_addr), -1, #PB_Ascii) + ldl::Logging("Connected IP:" + PeekS(Inet_ntoa_(lsockets_client(MapID)\sin_addr\s_addr), -1, #PB_Ascii), LoggerUUID, Log_Level_Info) FreeMemory(memory) ProcedureReturn ClientSID EndProcedure