NetTalk Central
The Rest Of NetTalk => The Rest - Ask For Help => Topic started by: HalfBubble on November 01, 2010, 12:53:26 PM
-
When a packet comes in, I get the request data:
self.WholePacketQueue.WholeBinData
and the reply IP:
self.packet.FromIP
Would it be reasonable to start a thread, put the answer to the request in some queue, and use the send method to send the response back while watching for other requests? (The boss is asking, "Can it be multi-threaded?"
Oh yes, Clarion 6.3 something. Nettalk version 4.53
-
Hi Half (or should that be Bubble?)
The short answer is yes.
The server should store the incoming details (specifically the packet.sockid, packet.fromip etc), place the packet in say a queue. Then other threads could update the queue (*). And the parent thread could send the reply as required.
(*) - note that Queues are NOT thread-safe. So unless you _really_ know what you are doing, you should use a MEMORY driver FILE here, not a Queue.
Cheers
Bruce