I have a question regarding identifying socket. Suppose I have 2 "socket types", a client and an attendant. Where is the chat of the 2, I can have several clients and several attendants, but my question is, how to identify each one?
I'm doing the following, but I do not know if it's a good practice or if there are better ways.
I have the class Server, which receives the Socket and instantiates a Class Gerencia_Socket
, when receiving the first message, defines if the socket is a client or attendant, if it is a client, it creates an object of type Gerencia_Cliente
, where has all the information of the client, if it is listener creates of type Gerencia_Atendente
, with the information of the attendant.
Is it feasible to do this? Because I already have 6 classes
-
Servidor
-
Gerencia_Socket
-
Gerencia_Cliente
-
Gerencia_Atendente
-
Atendente
(Socket itself) -
Cliente
(Socket itself)
Thank you in advance!