Page 1 of 1

NetworkServerEvent Trouble

Posted: Mon Oct 15, 2018 3:15 pm
by GenRabbit

Code: Select all

Procedure NetworkConnectionHandler(SocketSlots.i)
		Protected.i StreamEvent, ClientID
		Protected.i x
		Protected *TempBuffer
		Dim NetworkData(SocketSlots)
		Dim StreamControl(SocketSlots)
    	Repeat
	    	StreamEvent = NetworkServerEvent(ServerID)
Hi, why does the last line in a thread keep on giving me this error message:

TCPServer.pbi (Line: 471)
FreeMemory(): The specified '*MemoryID' is null. I checked with ServerID and that one is not 0.

Also, can EventClient() be used for unique ID. Read in some forum it is not?

Re: NetworkServerEvent Trouble

Posted: Mon Oct 15, 2018 11:56 pm
by wombats
Are you checking *TempBuffer is valid before trying to use it?

Have you enabled "Create threadsafe executable"?

Re: NetworkServerEvent Trouble

Posted: Tue Oct 16, 2018 6:26 am
by GenRabbit
Thanks, I totally forgot about the Threadsafe setting. That did it.
The *Tempbuffer isen't used before it starts to receive data.