Jump to content
  • Advertisement
Sign in to follow this  
madmaurice

Looking for Multithread Server Library

This topic is 3909 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to make a small c++ mmorpg with my friend. I use Linux and he uses Win XP. He's the one who creates the client ( graphics, etc.) and i create the server and the communication between both. i tried making a server with posix threads and linux sockets. With this solution i always got Memory Access Errors and I didn't get how to use select(). However i also tried using some libraries like RakNET(http://www.rakkarsoft.com) and OpenTNL(http://www.opentnl.org), but never found a solution to compile them and my source code with g++. Can you tell me about a easy-to-use AND easy-to-compile Networking Library that is multithreaded?

Share this post


Link to post
Share on other sites
Advertisement
lol? i'm not able to speak arabish or something like that :D: http://www.enet.gr/online/online

Just a joke. it was the first entry google found :P

Share this post


Link to post
Share on other sites
there not what i meant. i'm looking for a library/class that can accept multiple client but does not use any packet class. i want to create the protocol on my own.

Share this post


Link to post
Share on other sites
Quote:
Original post by madmaurice
there not what i meant. i'm looking for a library/class that can accept multiple client but does not use any packet class. i want to create the protocol on my own.


The real Enet is listed, as mentioned, in forum FAQ.

For TCP, implementing TCP support itself handles all the clients you need. Concept of connection is intristic to TCP.

For UDP, there is no concept connection, so a library either provides its own definition of what a connection is, and how data is sent, or it's, by definition, stateless and conectionless.

No matter which one you choose, you will need two pieces of functionality: serialization (storing arbitrary data to and from network buffers) and connection logic (making calls to networking API).

You might also want to look into different languages or platforms (C#, Java, Python), or even existing MMORPG libraries out there (Multiverse perhaps). All the libraries that have been mentioned are pretty typical with regard to usability.

Creating your own protocol is far from trivial if you want it to be done right. There are plenty of hidden pitfalls.

Share this post


Link to post
Share on other sites
However, ENet is not made for linux.

and what exactly don't you understand in my phrase "Just a joke. it was the first entry google found"?

if i would need a lib for creating mmorpgs i would ask for it and not for a library, to make an easy communication between server and client.

your opinion about creating an own protocol might be right but even then i didn't find any library/class, that can be includet or compiled on a linux pc.

and i don't want to look at different languages cause i all ready know programming with C#, Java and Python. And theyre not what i want to use to create my server.

Now, Do you have any more of your suggestions?

Or can you tell me how to compile a cpp file with kdevelop or g++, that uses RakNet or ENet(if there's a way to compile it under linux)?

Share this post


Link to post
Share on other sites
Quote:
Original post by madmaurice
However, ENet is not made for linux.


From the official ENet page:
Quote:
Portability
ENet works on Windows and any other Unix or Unix-like platform providing a BSD sockets interface. The library has a small and stable code base that can easily be extended to support other platforms and integrates easily. ENet makes no assumptions about the underlying platform's endianess or word size.


Linux provides BSD sockets.

Quote:
Or can you tell me how to compile a cpp file with kdevelop or g++, that uses RakNet or ENet(if there's a way to compile it under linux)?


Same way everything on Linux/Unix is compiled - by using the appropriate makefile, which happens to be included in ENet distribution.

Quote:
if i would need a lib for creating mmorpgs i would ask for it and not for a library, to make an easy communication between server and client.


Yes... That is an MMORPG library, which covers: OS networking API, serialization, state synchronization, versioning, security, authentication, object management and a whole lot of absolutely vital systems - and all of this is just networking. It doesn't even address the game itself, let alone the client or server. Those are where the difficult problems arise.

Share this post


Link to post
Share on other sites
Quote:
However, ENet is not made for linux.


That's funny, given that usually it's people on Windows complaining about how ENet is harder to build on Windows, because it's developed on UNIX and distributed using a .tar.gz file. It seems you didn't even look at it?

It seems to me that you don't need a networking library; you need a tutorial in building software in general, and using your development environment in particular. Networking adds a lot more complications, such as distributed flow of logic, and a potentially lossy transmission medium. Dealing with those is going to be impossible if you don't even know how the tools for a single machine work, first.

Anyway, if you know how to build C++ programs in general, and need a highly efficient and scalable I/O library that does sockets and other kinds of I/O, I would suggest boost::asio. It's well tested, portable, and fulfills all your requirements.

[Edited by - hplus0603 on November 5, 2007 1:30:46 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!