|
On Thu, 18 Apr 2002, Evan Harris wrote: > > Hi Tom and Scott > > I'm really having trouble trying to picture how this could be easier if the > server process is on the same machine as the proposed socket. Can someone > enlighten me how this would be less work ? Did I say it was less work? What I was trying to say is that when you use TCP/IP sockets, it's the exact same amount of work to put the client/servers on another machine, even if they're connected via dialup or Internet. > I've used data queues many times to control server processes but if there's > a better way I'm all ears. Hmmm... What do you mean by "better"? It seems to me that what's "better" and what's "worse" depends entirely on the needs of the project. > > BTW Scott, the two way communication - I find it easier to just have a > queue for each process. Part of the information a job sends to the server > on it's queue is the name of the queue to respond on. Seems to me that you have the same problem, there. Each client needs to send it's "address" (job number, client number, queue name, whatever it is, some unique ID) in each message that it sends to the server. Which also means that it needs some way of generating a unique ID. I'm not saying that data queues are bad. Certainly not! They're a great tool, but there are pros and cons to using data queues vs. sockets, and my goal was to try to list them. Again, there is no "better" or "worse", just a "better for this particular project". > Obviously this takes some planning up front but works pretty well. > Apologies if you already had this figured; I'll be surprised if you > hadn't ! :) I've used that scenario before... But I've found that a keyed data queue works better because you only have one object on disk, and don't have to worry about programs that crash and don't clean up after themselves. It's really the same thing, once you've generated a "unique ID" (Which you would've needed to make a unique name for the data queue) you can simply use it as the key... then you can just read messages for your own key... You can only do either your "multiple-queue" scenario, or my "keyed" scenario in a situation where you can trust all of the clients. Usually, if they're all on the same system, trust isn't an issue. But, for inter-system communications, they could interfere with each other by sending messages to each other's queues, or "spoofing" the other's unique ID -- and there's really nothing you can do about that with data queues. But, data queues are much easier to learn and implement... so, like I said, pros and cons...
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.