NetworkServerEvent() Crash
Posted: Sun Aug 14, 2005 12:27 am
Hi guys
I am having trouble with receiving data longer than 72 characters.
As soon as I SendNetworkString() of 73 or more characters the application crashes and reports "Invalid memory access" and highlights this line.
I've tried using a smaller databuffer (64bytes) but it still dies.
I can receive data if it is less than 73 chars.
Here's the chunk of code in question:
Is anybody else having this problem?
Is it a bug or am I making a stupid mistake somewhere?
I am having trouble with receiving data longer than 72 characters.
As soon as I SendNetworkString() of 73 or more characters the application crashes and reports "Invalid memory access" and highlights this line.
Code: Select all
NetEvent = NetworkServerEvent()I can receive data if it is less than 73 chars.
Here's the chunk of code in question:
Code: Select all
; check network events
NetEvent = NetworkServerEvent()
Select NetEvent
Case 1 ;New client connected
Case 2 ;Raw data
ClientID = NetworkClientID()
Buffer.l = AllocateMemory(64)
ReceiveNetworkData(ClientID,Buffer,64)
RecdText = Trim(PeekS(Buffer))
Debug "Recd: "+RecdText
SetGadgetText(#txtRecdText,"Text Received at "+FormatDate("%hh:%ii:%ss", Date())+" :")
SetGadgetText(#strRecdText,RecdText)
FreeMemory(Buffer)
Case 3 ; A file has been recieved
Case 4 ; Client disconnect
EndSelect Is it a bug or am I making a stupid mistake somewhere?