![](smile.gif)
Abstracting networking
Ok, so now I''ve gotten a decent hold of how sockets work and how to interact with other computers. At the moment the only abstraction I have is from raw sockets to slightly higher level classes that send/receive byte arrays, strings, and a couple other things.
What I need to do from here is make bigger abstractions and generally move things to a higher level of interaction with the network. I want to more or less structure my system like DirectPlay, but there''s one little problem--I don''t actually understand DirectPlay too well. As a result, I have absolutely no idea what I''m abstracting, how to build the class hierarchy, or even what classes/objects/abstractions should exist. I think I''ll crack open the DPlay9 docs tonight (not at home) but I need some idea of how to go about this.
Things that would be helpful:
Open source network engines, OO based, and a little more complex than just socket abstracts.
Some idea of how you did this in your engine
General tips/ideas of where to start
As usual, I''m essentially clueless, so please be pretty lucid in explaning
![](smile.gif)
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
from what you are saying i am guessing you have basic functions like
connect_to(ip_address, port);
send_data(data);
read_data(data);
once you have basic functions like that i would work on some sort of CSession class
where you would supply the session with the dest ip and port number
it will then automatically set up the connection and maintain it....ie...if the connection gets lost then it will try to reconnect. Lost connections can be something like someone somewhere unplugged a cable for a few seconds or a hicup in the internet.
and if you are using UDP then put some kind of reliability and ordering in the session layer
"A soldier is a part of the 1% of the population that keeps the other 99% free" - Lt. Colonel Todd, 1/38th Infantry, Ft. Benning, GA
connect_to(ip_address, port);
send_data(data);
read_data(data);
once you have basic functions like that i would work on some sort of CSession class
where you would supply the session with the dest ip and port number
it will then automatically set up the connection and maintain it....ie...if the connection gets lost then it will try to reconnect. Lost connections can be something like someone somewhere unplugged a cable for a few seconds or a hicup in the internet.
and if you are using UDP then put some kind of reliability and ordering in the session layer
"A soldier is a part of the 1% of the population that keeps the other 99% free" - Lt. Colonel Todd, 1/38th Infantry, Ft. Benning, GA
Um...what kind of functions would the session have? And would it be different on the client and the server?
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement