NetworkServerEvent Trouble

Everything else that doesn't fall into one of the other PB categories.
GenRabbit
Enthusiast
Enthusiast
Posts: 118
Joined: Wed Dec 31, 2014 5:41 pm

NetworkServerEvent Trouble

Post 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?
wombats
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Dec 29, 2011 5:03 pm

Re: NetworkServerEvent Trouble

Post by wombats »

Are you checking *TempBuffer is valid before trying to use it?

Have you enabled "Create threadsafe executable"?
GenRabbit
Enthusiast
Enthusiast
Posts: 118
Joined: Wed Dec 31, 2014 5:41 pm

Re: NetworkServerEvent Trouble

Post by GenRabbit »

Thanks, I totally forgot about the Threadsafe setting. That did it.
The *Tempbuffer isen't used before it starts to receive data.
Post Reply