473,397 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Queueing in Client Server Application

Hi,

I have a client server application where the client sends a request to
the server with a filename. The server needs to read the file
contents, massage the data, and then add it to the database. However,
if two requests show up at the same time, I need to create some sort
of a waiting mechanism or queue.

I was thinking about using a Singleton Server Activation object for
this reason, but I am not sure how I can implement the queueing
mechanism. As far as I know, once the server method is done adding the
file contents to the database, it will return true/false. But I need
it to pick up any pending files in the queue and process them as well.
At the same time, I don't want the first client request to wait until
all the files in the queue are processed.

The client also is waiting for a success/failure bool from the server
side method.

Any ideas on how I can accomplish this?

Asad

Feb 1 '07 #1
3 1898
Why do you need a waiting mechanism? You could certainly use a Queue object
to hold the requests and process them serially. But you could also use
QueueUserWorkItem onto the Threadpool with a specified callback and have them
all processed on threadpool threads in parallel.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"as*******@gmail.com" wrote:
Hi,

I have a client server application where the client sends a request to
the server with a filename. The server needs to read the file
contents, massage the data, and then add it to the database. However,
if two requests show up at the same time, I need to create some sort
of a waiting mechanism or queue.

I was thinking about using a Singleton Server Activation object for
this reason, but I am not sure how I can implement the queueing
mechanism. As far as I know, once the server method is done adding the
file contents to the database, it will return true/false. But I need
it to pick up any pending files in the queue and process them as well.
At the same time, I don't want the first client request to wait until
all the files in the queue are processed.

The client also is waiting for a success/failure bool from the server
side method.

Any ideas on how I can accomplish this?

Asad

Feb 1 '07 #2
Asad,

Since you don't specify too much of your current architecture, there are
some questions that would change the way you could do things.

a) do your client needs to wait for an answer or result?
b) does the server need to process the requests are they are sent or could
this be done from times to times?
c) are the files located on the server?
d) are clients/server running on the same physical network or do you have
the ability to have clients outside your network (like internet)?

With these answers, I think I could be of more help.

--
Regards,
Robson Siqueira
Enterprise Architect
<as*******@gmail.comwrote in message
news:11*********************@v45g2000cwv.googlegro ups.com...
Hi,

I have a client server application where the client sends a request to
the server with a filename. The server needs to read the file
contents, massage the data, and then add it to the database. However,
if two requests show up at the same time, I need to create some sort
of a waiting mechanism or queue.

I was thinking about using a Singleton Server Activation object for
this reason, but I am not sure how I can implement the queueing
mechanism. As far as I know, once the server method is done adding the
file contents to the database, it will return true/false. But I need
it to pick up any pending files in the queue and process them as well.
At the same time, I don't want the first client request to wait until
all the files in the queue are processed.

The client also is waiting for a success/failure bool from the server
side method.

Any ideas on how I can accomplish this?

Asad

Feb 1 '07 #3
a) Yes, the client is waiting for a success/failure response from the
server.
b) The server must respond and work on the request immediately and
return the result.
c) No the files are located on a seperate server. The client
application will be on the workstations spread out across the company.
The server application will be running on a SQL server machine. And
the files are physically located on a third server machine we have.
d) No internet. Everything is on the same network.

Asad

On Feb 1, 4:27 pm, "Robson Siqueira" <rob...@robsonfelix.comwrote:
Asad,

Since you don't specify too much of your current architecture, there are
some questions that would change the way you could do things.

a) do yourclientneeds to wait for an answer or result?
b) does theserverneed to process the requests are they are sent or could
this be done from times to times?
c) are the files located on theserver?
d) are clients/serverrunning on the same physical network or do you have
the ability to have clients outside your network (like internet)?

With these answers, I think I could be of more help.

--
Regards,
Robson Siqueira
Enterprise Architect<asadik...@gmail.comwrote in message

news:11*********************@v45g2000cwv.googlegro ups.com...
Hi,
I have aclientserverapplication where theclientsends a request to
theserverwith a filename. Theserverneeds to read the file
contents, massage the data, and then add it to the database. However,
if two requests show up at the same time, I need to create some sort
of a waiting mechanism or queue.
I was thinking about using a SingletonServerActivation object for
this reason, but I am not sure how I can implement thequeueing
mechanism. As far as I know, once theservermethod is done adding the
file contents to the database, it will return true/false. But I need
it to pick up any pending files in the queue and process them as well.
At the same time, I don't want the firstclientrequest to wait until
all the files in the queue are processed.
Theclientalso is waiting for a success/failure bool from theserver
side method.
Any ideas on how I can accomplish this?
Asad

Feb 2 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Matt | last post by:
I think this is the basic concept in ASP server-side development. My boss told me web application is NOT client-server application. I argued with him because browser is the client, and the server...
2
by: Stephen Barrett | last post by:
Does anyone know of any good sites or books to read up on using Windows Message Queue with .Net? I am starting to convert a long standing PowerBuilder server application to .Net. The current...
2
by: Microsoft | last post by:
I'm about to start converting my application from a old-style monolith exe (with flat files and limited database support for sharing some of the data) to a layered .NET SQL server version. I have...
18
by: cjl | last post by:
Hey all: I know that it is silly in the age of Google to 'lose' something on the internet, but I recently checked out a project that had implemented a database with a subset of SQL in pure...
4
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times....
11
by: Timothy Shih | last post by:
Hi, I am having a freezing issue with my application. My application serves several remotable objects, all of which must be initialized before their use. Furthermore, some of them depend on each...
6
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program...
2
by: Wimpie van Lingen | last post by:
Hey I have some more questions with regards to Remoting in .NET 2. I'm using TCP with the Binary formatter. My solution consists of 4 projects: - Class Library containing the server classes...
6
by: shakthi | last post by:
I have problem with message queuing. I wrote simple service and client that communicate through endpoint that works with netMsmqBinding. Exception occurs when client sends message to server, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.