?
Solved

Server development issues.

Posted on 2005-02-28
7
Medium Priority
?
260 Views
Last Modified: 2012-08-13
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.

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.


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

All suggestions are welcome.

Thanks,
rdh
0
Comment
Question by:rohitdivas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 22

Assisted Solution

by:grg99
grg99 earned 300 total points
ID: 13419031
If these are all going to be connection-oriented protocols, with identical data formats, then you can share a fair amount of code.

But I suspect many of the protocols are going to require special-casing.

 In which case you may be able to only share some peripheral code, such as logging, file-caching, and back-end database lookups.  
0
 

Author Comment

by:rohitdivas
ID: 13419067
You are correct grg99 in that i will be reusing only the logging, multithreading , data-reading part of the code.

But the main issue is how to handle the various protocols connection-less as well as connection oriented. How the server handles multiple clients, some communicating over TCP , some over IPX, SAP?? This is the one of the major part of discussions. :)

Has anybody tackled similiar sort of situation before ???

All suggestions/ comments are welcome.

RDH
0
 

Author Comment

by:rohitdivas
ID: 13419163
Also, we 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.

All suggestions are welcome.
rohit
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Accepted Solution

by:
grg99 earned 300 total points
ID: 13420754
Hmmm, well I don't see any alternatives-- you're going to need a separate little loop to handle each of the protocols.   Each loop will have to create a socket for that protocol, then either wait for a connection or wait for a datagram.  Then read in the request.  Then you can call the generic "gimme back the data for this request" fnction that shoul dbe the same for all protocols.  Then when you get the answer, some protocol-specific code to send out the answer.

It's possible to do this in ONE module, with some clever use of method pointers-- that makes for less code and clearer code, but perhaps harder to debug.  

0
 

Author Comment

by:rohitdivas
ID: 13426433
hi grgg99,
thanks for the comments. what i can think of is making the module of structure as shown below and then call the appropriate object according to the protocol used by the client. Please comment.
===========
class protocol{

public:
      virtual void TCP_protocol() {cout<<"base tcp protocol"<<endl;} //functionality i.e when the connection is established using TCP protocol
      virtual void IPX_protocol() {cout<<"base ipx protocol"<<endl;}
      virtual void SAP_protocol() {cout<<"base SAP protocol"<<endl;}


};

class TCPp : public protocol {

public:
      void TCP_protocol() {cout<<"TCPp class fun()"<<endl;}
      void some_otherfunctions();
 
};

class IPXp : public protocol {

public:
      void IPX_protocol() {cout<<"IPXp class fun()"<<endl;}
      void some_otherfunctions1();
 
};

class SAPp : public protocol {
public:
      virtual void SAP_protocol() {cout<<"SAPp class fun()"<<endl;}
      void some_otherfunctions1();
 
};

//And in the main function  assigning
void main() {

protocol* pobj;
TCPp TCPobj;
IPXp IPXobj;

//And in loop, after checking the type of protocol ,
switch (protcol_type)
{
case TCP:
pobj = &TCPobj;
pobj->TCP_protocol();
break;

case IPX:
pobj = &IPXobj;
pobj->IPX_protocol();
break;

//and so on...
}

}

===========
Is this method seems feasible ?
rdh
0
 

Author Comment

by:rohitdivas
ID: 13438137
Please allow me to change my previous query,
I am in process of developing a server and currently analyzing various
models to develop the same. 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 anybody suggest a
server model that suits my requirement.


how about RPC mechanism ? Will RPC mechanism be able to satisfy above requirements ??


All suggestions are welcome.
Awaiting for the reply,
Thanks,
rdh


0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question