N
Naren
Hello All,
I am presently designing a cleint server architecture.
I require some suggestions and help by the experts here.
MyServer class conatins a list of Mysock class.
class Myserver
{
private:
list<Mysock> L1;
};
MySock is a class containing the socket information
class MySock
{
private:
int _socketdesc;
Type *pType;
};
Type is a class which conatins the device type and an ID of the device
which connects to the server
class Type
{
private:
eType e;
int ID;
};
Now when a command has to be sent to some device. I get its ID, eType
and the command.
This has to be sent to the unique device.
SO here you see that I have to do a linear search for the correct
device to send the command.
The type class is filled by the Mysock class after recieving the first
packet containing the information. so a type object is created by the
Mysock class.
Now if Myserver had a list of Newtype
class Newtype
{
private:
etype e;
list<NewID> L;
};
class NewID
{
private:
int ID;
int _socketdesc;
};
This helps in searching the device fast but since type information is
obtained after recieving the first paket I am not able to use this
approach.
Could anyone help me?
Thanks in advance.
Regards,
Naren.
I am presently designing a cleint server architecture.
I require some suggestions and help by the experts here.
MyServer class conatins a list of Mysock class.
class Myserver
{
private:
list<Mysock> L1;
};
MySock is a class containing the socket information
class MySock
{
private:
int _socketdesc;
Type *pType;
};
Type is a class which conatins the device type and an ID of the device
which connects to the server
class Type
{
private:
eType e;
int ID;
};
Now when a command has to be sent to some device. I get its ID, eType
and the command.
This has to be sent to the unique device.
SO here you see that I have to do a linear search for the correct
device to send the command.
The type class is filled by the Mysock class after recieving the first
packet containing the information. so a type object is created by the
Mysock class.
Now if Myserver had a list of Newtype
class Newtype
{
private:
etype e;
list<NewID> L;
};
class NewID
{
private:
int ID;
int _socketdesc;
};
This helps in searching the device fast but since type information is
obtained after recieving the first paket I am not able to use this
approach.
Could anyone help me?
Thanks in advance.
Regards,
Naren.