473,699 Members | 2,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

client -server interaction over XML supporting multiple protocols

rdh
Hi all,

I am in process of developing a Server in C++ supporting multiple
protocols. The server will be exposing various functionalities , and the
clients can communicate over any of the protocols may be TCP, IPX, SAP,
NETBEUI to access the server to access the functionalities exposed. The
server doesnot know in advance which client is using what protocol.
ALSO, ALL THE INTERACTION WILL BE MADE OVER XML.

example my server has functionality X()

and i have n number of client.
client1 is communicating over protocol TCP to access X()
client2 is communicating over protocol IPX to access X()

...
and so on.
We had already developed ( prepared a rough code sketch), a server that
is able to handle multiple clients at the same time over TCP /IP. But
now, we need to enhance the same so that it can intearct with clients
irrespective of the protocol being used.

I am struck with following issue:

1) How to make the client-server flow so that the server knows from
which protocol the client has communicated so that the server can send
the reply over the same protocol and this whole process is
multithreaded.

What all steps are needed to take care of while building the system
most efficient.

In summary
need to make server in such a way that it may accept a request from
connection oriented protocol as well as connection-less protocol at the
same time. so need to develop a mechanism for the same the work for all
conditions.

Please suggest. Also please feel free to send your comments/suggestions
to make this system more efficient.

All suggestions are welcome.

Thanks,
rdh

Jul 23 '05 #1
7 3306
On Tue, 1 Mar 2005 05:54:12 UTC, "rdh" <ro***********@ gmail.com> wrote:
Hi all,

I am in process of developing a Server in C++ supporting multiple
protocols. The server will be exposing various functionalities , and the
clients can communicate over any of the protocols may be TCP, IPX, SAP,
NETBEUI to access the server to access the functionalities exposed. The
server doesnot know in advance which client is using what protocol.
ALSO, ALL THE INTERACTION WILL BE MADE OVER XML.

example my server has functionality X()

and i have n number of client.
client1 is communicating over protocol TCP to access X()
client2 is communicating over protocol IPX to access X()

..
and so on.
We had already developed ( prepared a rough code sketch), a server that
is able to handle multiple clients at the same time over TCP /IP. But
now, we need to enhance the same so that it can intearct with clients
irrespective of the protocol being used.

I am struck with following issue:

1) How to make the client-server flow so that the server knows from
which protocol the client has communicated so that the server can send
the reply over the same protocol and this whole process is
multithreaded.

What all steps are needed to take care of while building the system
most efficient.

In summary
need to make server in such a way that it may accept a request from
connection oriented protocol as well as connection-less protocol at the
same time. so need to develop a mechanism for the same the work for all
conditions.

Please suggest. Also please feel free to send your comments/suggestions
to make this system more efficient.

All suggestions are welcome.

Thanks,
rdh


Hello rdh,

Look up some of the ancient examples of server code under Unix/linux
for TCP/IP. The typically most complicated example of how to write
the server side covers multi-service, multi-protocol servers.

You simply need to associate the proper protocol with each of your
connections. This may already be part of the connection information
if all of your protocols come in on a standard interface. If you
use multiple threads or interfaces to handle all of the protocols
you just need to provide a common interface that can be used by the
rest of your request-response engine.

You will need to decide if your target operating system, server
model, and request-response engine is best implemented as a single
process or multiple processes. 'process' here could mean just
about anything based on the various operating system models that
are available. For instance, the overhead of your XML decoder-
encoder or request-response engine for each conversation may
overload some operating system models. At times it is better to
keep some services separate. This all depends on the complexity
of your function X().

It is likely that the stream oriented (TCP) and packet oriented
(UDP) protocols will provide a unified view to another layer
of your server that actually performs the XML parse or encode.
The complexity of putting this all together also largely depends
on your experience and the tools that you choose for the project.
If you doubt your ability to put it all together the first time,
implement the final optimized strategy in steps. That also allows
you to change your design if problems are found in the design.

You may be able to find much of what you need already available
in other packages or combinations of packages. I have my own
client-server models that I can simply drop just the conversation
engine (request-response engine above) in and select what kind of
server or client model I want to implement. I'd offer them but
they are not likely to meet your needs as they target a certain
class of linux and other embedded systems.

In review, for (1) if your communication model is Unix/linux
based or Microsoft based, check out the definition of communications
sockets. You are likely to find that the definition of a socket
can be either UDP, TCP, IPX, and so on. If I recall correctly these
are called the Interface Families. You just need a plug-in or support
for all of your desired protocols in your operating system and the
socket communications layer will hide most of the details for you.
You will still need to address the stream vs. packet mode yourself.

The optimized solution (2) for the entire multi-protocol server,
XML, and function X() are best derived based on experience. The
size of the XML and X() functionality will determine the demands
on your operating system. C++ can easily handle multi-protocol
servers and the other components you are likely to need. However,
some of the underlying complexity of the XML engine or X()
functionality may degrade performance as the number of conversations
rise. This generally isn't a problem for simple communications
and X() functionality. If X() was a time consuming or large
overhead task, your performance may be better with a slightly
different model. You will need to play around with the design
if you cannot meet your target goals. You likely have some
idea of the complexity of the XML and X() functionality already.
Also consider the number of simultanious clients served, client-to-
client interactions if needed, and the desired response time.

David
Jul 23 '05 #2
rdh
Hi David,

Thanks for the reply. was really very informative. I am in process of
analyzing various models to develop the server. My basic requirement is
that :

1) Server can be easily ported to UNIX/LINUX OSes, initiallly to be
developed for Windows platform.
2) Implementation will be done in C++
3) The interaction / communication will be done via XML
4) Server should accept the connection over any of the protocols
connection oriented or connection less.
5) The data to be transeferred between client-server is very light and
doesnot involve complex heavy data.

So m in process of evaluating various servers. Can you please suggest a
server model that suits my requirement.

B.W how about RPC mechanism ? Can it be implemented in Windows also ???

Awaiting for your reply,
Thanks,
rdh

Jul 23 '05 #3
Hello rdh,

On Wed, 2 Mar 2005 07:29:50 UTC, "rdh" <ro***********@ gmail.com> wrote:
Hi David,

Thanks for the reply. was really very informative. I am in process of
analyzing various models to develop the server. My basic requirement is
that :

1) Server can be easily ported to UNIX/LINUX OSes, initiallly to be
developed for Windows platform.
When portability or cross-compatibilty are part of the initial
goals, I think it is best to design with those concepts in mind.
I generally presume these techniques even though many projects
seem to grow out of toolsets that already exist from a given
system. Each methodology has its costs and benefits that we
must balance.

The *ix sockets are the most standard across many platforms.
The Windows WinInet at just the socket layer is also very
campatible with the *ix interfaces. Initialization and
termination have mild differences.

Threading and process models will be different on most
platforms. Design with that in mind. You may find certain
thread classes useful. You can also build your own.
When you have the knoweldge it is usually best to presume
your custom abstraction can grow. When you have no idea
about the abstractions common libraries can be helpful
but often never provide an optimal solution on any plaftorm.
This is certainly true of GUI abstractions.

Try to keep the code that may vary between the OSes
separate from your common code. For instance, a good design
usually keeps the verification logic in one place and the
GUI component in another. The GUI components will be
expected to be different for each platform. When the
verification logic is pure C++ and common code libraries
there will be less need for OS-abstracted versions.

This list could go on forever. It might be helpful to
keep a light implementation on *ix just to verify things
as you build them under Windows.

Beware of the MFC and Windows libraries. They are not
portable and *ix variants may have significant use
characteristics that make portable code hard to maintain.
2) Implementation will be done in C++
C++ is available for many platforms. There may be slight
differences in what level of STL is available or other
common libraries. These can usually be worked around without
much difficulty.
3) The interaction / communication will be done via XML
That is up to you. You will need to decide how packetized
data will be handled. Will XML conversations ever span a
packet? If so, how will you write that abstraction? If not,
will the XML size constraints significantly hinder the request
or response size?

Even with XML, what will the conversation look like?
HTTP-like conversations are generally simple request-response
with a stateless conversation model. Will you have that
model or something a bit different?
4) Server should accept the connection over any of the protocols
connection oriented or connection less.
Your initialization of each protocol may be a bit different on each
OS. The base server can be standardized fairly easily. The threading
andsynchronizat ion models are what might dictate separate implementations .
5) The data to be transeferred between client-server is very light and
doesnot involve complex heavy data.
I presume you also will not have heavy or complex processing to
service requests. Scalability will also be affected by how many
converations and protocols you plan to have active at the same time.
So m in process of evaluating various servers. Can you please suggest a
server model that suits my requirement.
I'd suggest a simple multi-threaded, multi-protocol server as the
base. These will probably need to be different for each platform
due to the threading and synchronization models required by each OS.

XML can be rather nasty to properly implement unless you are using
a rather restricted definition (which is okay). A library common to
your presumed target OSes may be helpful. Xerces(sp?) and other
libraries come to mind.

Your core request-response processor will likely be portable C++
with use of the XML library calls that you standardize on.

The STL or common C/C++ libraries may provide most of the
other tools that you will need.

Database concepts are available on many platforms if they
are needed. Other concepts that you masy need are likely to
be found on various platforms.

Gluing all of these layers together on all target platforms
should not be too difficult a task.

If you start on just Windows and plan to provide another OS
later, it may be wise to periodically check for Windows
specific concepts and adjust your developments as needed.

Keeping the install, path/file concepts, and any UIs separate
for each platform may be helpful.
B.W how about RPC mechanism ? Can it be implemented in Windows also ???
Windows has some RPC functionality built in. Care must be taken
when depending on IE for your XML or RPC processing. A different
tool must be found under *ix. Depending on each interface chosen
there may be significant rewrite on each platform. I've seen several
XML tools that approach the general API differently on the same
platform. Even under Windows, there are perhaps a dozen ways of
processing XML or RPC transactions.

In general, anything *ix can do Windows can do. Each platform
has certain APIs and abtractions geared toward solving problems
in a different way. What takes Windows and Visual Basic a few
lines, may take volumes when done elesewhere. There is a reason
for the bloat underneath Windows (and linux). Each has some
very powerful tools included. Choosing the common abstractions
that you need will probably server you best.

If you can avoid XML, there may be more optimal ways to
handle your conversation needs. I usually presume people
know when they require XML and accept its inherant processing
requirements. I've seen more than a few teams base products
on XML and later wonder why certain functions take a huge
amount of time or produce seemingly endless amounts of
data. Just remember that it may be an option to question
certain design constrants or decisions if you have control
of all the parts.
Awaiting for your reply,
Thanks,
rdh


Sorry for the long diatribe. I should have answered
tomorrow when I'd had time to get some much needed
rest. I'll probably be off-line tomorrow -- or is that
later today?

David
Jul 23 '05 #4
rdh
Hi David,
Thanks for the reply. That was very informative!!

The idea for making the model multithreaded-multiprocol seems quite
good according to the situation. But at the moment, I am exploring
other models as well, more keen in RPC mechanism.

How about using XML-RPC ?(XML-RPC is a simple, portable way to make
remote procedure calls over HTTP.) I feel this mechanism suits my
requierments. What do you suggest ?

Thanks and Regards,
rdh

Jul 23 '05 #5
Hello rdh,

On Thu, 3 Mar 2005 11:56:29 UTC, "rdh" <ro***********@ gmail.com> wrote:
Hi David,
Thanks for the reply. That was very informative!!

The idea for making the model multithreaded-multiprocol seems quite
good according to the situation. But at the moment, I am exploring
other models as well, more keen in RPC mechanism.
Exploring your options is a good tactic.
How about using XML-RPC ?(XML-RPC is a simple, portable way to make
remote procedure calls over HTTP.) I feel this mechanism suits my
requierments. What do you suggest ?
That may be appropriate. Perhaps we should take this discussion
to email. I'll send an email to your posted address. If that isn't
valid send me an email at [huey dot dll at gte dot net].

If you are exploring several conversation models as well as
existing technologies, don't forget the most simple and obvious
methods, such as text and binary messages. They only fail when
your needs exceed your initial design and are extremely easy
to document and implement. Take for example the basic design
of SMTP for email. I can't think of a particular example for
a binary mode that involved simple message protocols. The
IP headers might be a good example. If you are unfamiliar with
these look up the term RFC (Request For Comments) and check
out a few of the more popular legacy protocols. XML takes
a bit more to process but it does provide additional language
support and tools are starting to emerge for middleware.

Perhaps if we talk about your actual transactions I
could recomend a few protocols to evaluate.
Thanks and Regards,
rdh


David

Jul 23 '05 #6
u have to use tcp/ip,

for connection.

u can send me u r server code aswell as client code.

i may modified it.
rdh wrote:
Hi all,

I am in process of developing a Server in C++ supporting multiple
protocols. The server will be exposing various functionalities , and the clients can communicate over any of the protocols may be TCP, IPX, SAP, NETBEUI to access the server to access the functionalities exposed. The server doesnot know in advance which client is using what protocol.
ALSO, ALL THE INTERACTION WILL BE MADE OVER XML.

example my server has functionality X()

and i have n number of client.
client1 is communicating over protocol TCP to access X()
client2 is communicating over protocol IPX to access X()

..
and so on.
We had already developed ( prepared a rough code sketch), a server that is able to handle multiple clients at the same time over TCP /IP. But
now, we need to enhance the same so that it can intearct with clients
irrespective of the protocol being used.

I am struck with following issue:

1) How to make the client-server flow so that the server knows from
which protocol the client has communicated so that the server can send the reply over the same protocol and this whole process is
multithreaded.

What all steps are needed to take care of while building the system
most efficient.

In summary
need to make server in such a way that it may accept a request from
connection oriented protocol as well as connection-less protocol at the same time. so need to develop a mechanism for the same the work for all conditions.

Please suggest. Also please feel free to send your comments/suggestions to make this system more efficient.

All suggestions are welcome.

Thanks,
rdh


Jul 23 '05 #7
rdh
Hi sidduramp,

XML-RPC mechanism seems quite feasible option , so I am in process of
evaluating/analyzing more into it.

rohit

Jul 23 '05 #8

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

Similar topics

7
2297
by: Chris | last post by:
<apologies for cross-posting> Hi All, I am based in the UK and have been doing some private work for a client which involved setting up a database and scripts to search it and display results etc, all the usual stuff. The work was at about the halfway point when the client asked for a time estimate for the whole project. I sent him this and he wrote back
2
4665
by: Rhino | last post by:
I am trying to verify that I correctly understand something I saw in the DB2 Information Center. I am running DB2 Personal Edition V8.2.1 on Windows. I came across the following in the Info Center: To return a result set from a procedure to the originating application, use the WITH RETURN TO CLIENT clause. When WITH RETURN TO CLIENT is specified on a result set, no nested procedures can access the result set.
5
2216
by: Paul H | last post by:
How do you folks get a reliable and complete brief of what is required before development starts? I am forever going back to a client once a project has started saying "Hang on, now that I've started building this I realise what you want is impossible, we'll have to do this way instead....etc.." OK, so this is partly down to me not getting all the facts from day one, but if the client does not give detailed, accurate instructions there...
7
2921
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure out to create a "DataSet" as the return type from the webservice?
11
4206
by: pshindle | last post by:
We have several machines currently running the DB2 V7 Run-time Client that we would like to actually be running the App Dev Client. To 'upgrade' (within the same version) this client software can we simply install the App Dev Client on 'top of' the Run-time Client? Will the install routine uninstall the Run-time Client under the covers during the install of the App Dev Client? Also, is this type of 'upgrade' possible/supported during a...
2
7571
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking. Any help appreciated! The ordeal is a follows I am using Solaris 10 with php5.1.1. GCC:
11
2205
by: Wayne | last post by:
I am a one man enterprise and have been asked by a prospective client what happens to their database regarding ongoing changes etc if I get hit by a bus. Obviously my databases are distributed as mde files in an effort to protect my intellectual property. How do I give the client peace of mind, short of giving them a backup mdb file that any programmer could work on to provide required changes etc if I wasn't around? Of course this...
3
2616
by: rjha94 | last post by:
Hi I just installed the runtime client on my windows machine. when i go inside the SQLLIB\bin folder i can see db2.exe. is it possible to use this db2 bundled with runtime client for command line processing? Because all the documents tell you to get an administration/ application client to do such thing. Thanks - Rajeev.
4
9287
MMcCarthy
by: MMcCarthy | last post by:
http://bytes.com/images/howtos/projectscope_blocks.jpgAs a freelance IT consultant for over 10 years, I’ve come to appreciate well defined project scopes. A project scope is a common understanding between you and your client as to what work is included in, or excluded from, a project.In a study done by CA towards end of last year, one third of all projects end up over budget and over-spend typically 10-20% of the original budget. Primary reasons...
11
7717
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which enabled me to the contacts at least list. I had to root around to discover CdoDefaultFolderContacts (though it was guessable; how could I enumerate win32com.client.constants?). I now want to work through the Contacts in Outlook patching in...
0
8703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8623
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7773
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6540
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4389
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.