Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Sep : Accessing a central resource?
| Subject: | Accessing a central resource? |
| Posted by: | "Toby Piper" (ne..@compcraft.com) |
| Date: | Thu, 13 Sep 2007 21:00:37 |
What I need to do is create a server that accepts connections from multiple
clients that pass requests of a variable length that start with STX (#2) and
end with ETX (#3).
This server will in turn serialize those messages to another server that can
only accept one connection at a time.
My server accept simultaneous connections from clients and create a
continuous connection to the other server and then will pass the client
requests to the other server, receive a response and pass that response back
to the appropriate client.
So I need to keep two central TCP message queues (requests and responses)
that the threads can access.
I can't find ANY examples that deal with sharing a resource between the
threads and synchronizing accesses. I DID see something on the net about
using critical sections to control access. Is that the way to go?
Any other ideas how to accomplish this?