Link to home
Start Free TrialLog in
Avatar of rohitdivas
rohitdivas

asked on

Server development issues.

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
SOLUTION
Avatar of grg99
grg99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rohitdivas
rohitdivas

ASKER

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
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
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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