AI 2008 Network Subsystem.
Posted: 20 Oct 2008, 09:03
OK. It's time to design a new "Network" subsystem.
Package design:
Network
|-Server (Server functions, create socket, listen, close socket, call parser, and send).
|-Client (Client functions, establish socket, listen, close socket, call parser, and send).
|-MessageTokenizer (Split's stream to packets. No Networking functions here, just return a whole packet, or store at local buffer.)
|-Send (Send packets to Server)
|~|-ServerTypeX
|-Receive (Receive packets from Server)
|~|-ServerTypeX
|-XKore_Send (Send packets to client)
|~|ServerTypeX
|-XKore_Receive (Receive packets from client)
NetworkSub (Network Sub System types, and constructors)
|-DirectConnection
|-XKore
|-XKore2
|-XKoreProxy
|-e.t.c
Comunication:
1) Every "NetworkSub" must have at least two functions "new" and "SendRaw" and one hash blessed by "Network::Send" called "$self->{send_to_server}".
2) "Network::Receive" must push all messages to "$environment_change_Queue". Those will be interpreted by "AI::Environment::Queue". <-- All messages need to be documented out.
Everybody is welcome to suggest it own ideas, and implementations!
Package design:
Network
|-Server (Server functions, create socket, listen, close socket, call parser, and send).
|-Client (Client functions, establish socket, listen, close socket, call parser, and send).
|-MessageTokenizer (Split's stream to packets. No Networking functions here, just return a whole packet, or store at local buffer.)
|-Send (Send packets to Server)
|~|-ServerTypeX
|-Receive (Receive packets from Server)
|~|-ServerTypeX
|-XKore_Send (Send packets to client)
|~|ServerTypeX
|-XKore_Receive (Receive packets from client)
NetworkSub (Network Sub System types, and constructors)
|-DirectConnection
|-XKore
|-XKore2
|-XKoreProxy
|-e.t.c
Comunication:
1) Every "NetworkSub" must have at least two functions "new" and "SendRaw" and one hash blessed by "Network::Send" called "$self->{send_to_server}".
2) "Network::Receive" must push all messages to "$environment_change_Queue". Those will be interpreted by "AI::Environment::Queue". <-- All messages need to be documented out.
Everybody is welcome to suggest it own ideas, and implementations!