Help with server side best practices

  • Thread starter Thread starter Winston Nimchan
  • Start date Start date
W

Winston Nimchan

Hi:

I am trying to develop a server application that listens for incoming
network request and processes these requests. Processing request involves
analyzing the packet, applying business rules, updating database and
generating a response packet.

What is the best way to go about this?

I've downloaded code from the net that creates an asynchronous socket server
but I have some concerns about what I'm doing. Threads are created for each
incoming socket and when data is received on a particular socket, the
delegate is called. the problem is that if a second socket/thread receives
data while the first socket/thread is in the delegate, the second thread
waits for the first thread to exit the delegate. It might be a while before
the first thread finishes.

Is it wise to make async calls from my delegate to the objects that will be
processing the request?

Forgive me if I sound confused.

Regards

Winston
 
Winston said:
Hi:

I am trying to develop a server application that listens for incoming
network request and processes these requests. Processing request
involves analyzing the packet, applying business rules, updating
database and generating a response packet.

What is the best way to go about this?

I've downloaded code from the net that creates an asynchronous socket
server but I have some concerns about what I'm doing. Threads are
created for each incoming socket and when data is received on a
particular socket, the delegate is called. the problem is that if a
second socket/thread receives data while the first socket/thread is
in the delegate, the second thread waits for the first thread to exit
the delegate. It might be a while before the first thread finishes.

Is it wise to make async calls from my delegate to the objects that
will be processing the request?

Forgive me if I sound confused.

Is it necessary to write your own application server? If this is a business
application, you could be using IIS and ASP.NET web apps or web services.

Cheers,
 
Thankx for your suggestion

Basically this is what I want to achieve...
A POS terminal captures data and formats according to ISO8583 protocol
Connects to my host via tcpip and sends the request
My host decodes the request, processes it and generates a response to the
terminal

What do you think is the best, quickest way to achieve this

Winston
 
Back
Top