;this is norm TCP client DLL Global Buffer.s Global *COMBUFFER Global MAXCOMBUFFER.l Global ONLINE.l ProcedureDLL AboutIni(C.s,T.s) msg.s=T+Chr(10) msg=msg+"Date ="+FormatDate("%yyyy,%mm,%dd",#PB_COMPILER_DATE)+Chr(10) msg=msg+"Time ="+FormatDate("%hh:%ii:%ss",#PB_COMPILER_DATE)+Chr(10) msg=msg+"Norms Proxy File DLL" MessageRequester(C,msg,0) EndProcedure ProcedureDLL.l PrepLibrary() reply.l=InitNetwork() ProcedureReturn reply EndProcedure ProcedureDLL.l ConnectToProxy(*ISP,port.l,size.l,*name) reply.l=0 If ONLINE MessageRequester("Network Error","I show a preexisting connection",#MB_ICONSTOP) Else *COMBUFFER=AllocateMemory(1,size,0) MAXCOMBUFFER=size ONLINE=OpenNetworkConnection(PeekS(*ISP),port) If ONLINE msg.s=Chr(147)+"9999N"+Left(PeekS(*name)+" ",8) If Len(msg)>MAXCOMBUFFER msg=Left(msg,MAXCOMBUFFER) EndIf PokeS(*COMBUFFER,msg,Len(msg)) SendNetworkData(ONLINE,*COMBUFFER,Len(msg)) Delay(1) reply=1 Else MessageRequester("Network Error","Unable to connect to proxy",#MB_ICONSTOP) EndIf EndIf ProcedureReturn reply EndProcedure ProcedureDLL SendData(*mem,size) If size>MAXCOMBUFFER size=MAXCOMBUFFER EndIf If ONLINE SendNetworkData(ONLINE,*mem,size) Delay(1) Else MessageRequester("Network Error","Invalid connection",#MB_ICONSTOP) EndIf EndProcedure ProcedureDLL.l CheckData(*mem,size) reply=0 If ONLINE If NetworkClientEvent(ONLINE)=2 reply=ReceiveNetworkData(ONLINE,*mem,size) EndIf Else MessageRequester("Network Error","Invalid connection",#MB_ICONSTOP) EndIf EndProcedure ProcedureDLL CloseConnection() If ONLINE CloseNetworkConnection(ONLINE) ONLINE=0 EndIf EndProcedure ; ExecutableFormat=Shared Dll ; Executable=C:\Program Files\PureBasic\Projects\Matching\clientdll.dll ; EOF