Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Bugs in nio? I'm paranoid!  (Read 3362 times)
0 Members and 1 Guest are viewing this topic.
Offline tufflax

Junior Newbie





« Posted 2011-06-24 16:29:35 »

Hey! I made a thread over at gamedev about a problem I had with networking. One respons I got said that Java nio has bugs that has not been fixed. Is this really true? I find it strange, but he sounded pretty sure. Take a look: http://www.gamedev.net/topic/604811-how-common-is-data-errors-in-tcp/

Also, I started thinking about using some sort of networking library instead. I want to make an MMO that can support a few hunderd players, and I want to use TCP. I want something that just works so that I can get on with my game. I have looked a bit at Mina, and it seems nice. Any tips or suggestions?
Offline loom_weaver

JGO Coder


Medals: 17



« Reply #1 - Posted 2011-06-24 19:43:00 »

While I can make a little sense out of Clojure, I doubt that having me stare at the code will help you in any fashion.

If you can make a stand-alone Java app that includes both the client and server then I'd be willing to run it on my system and see if the error shows itself.  I'm sure others would too.
Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #2 - Posted 2011-06-24 20:02:37 »

*Ahem* Now I've done pretty much networking, and keeping servers running java code for months without a crash. That was done with the basic I/O, and the custom NIO implementations in Mina, and later JBoss' Netty. Haven't experienced leaks of any sort related to the use of these packages. Of course you could've made a mistake yourself.

Also, the point that the Moderator made in that thread is really good. You don't see errors in the data-transmission at all (unless you're using UDP, and not handling things accordingly). I've also made dumps of several gigabytes because I wanted some media, and databases that i only could access through HTTP, and I've never ever experienced faults in the transmission.

I would be happy to run your code a couple of hours if it's just a light daemon to test, if needed.

Cheers.


EDIT:
I haven't used the NIO in java that's provided a lot (a couple of weeks work tops), but I really don't think you'd find these massive bugs in it. If unsure, just use Netty. It's easier to use, and should provide better performance than Mina (I've seen some benchmarks of the same servers, with the different libraries, and the difference was slight, but big enough to notice if you're handling 2k connected users).

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tufflax

Junior Newbie





« Reply #3 - Posted 2011-06-24 20:51:48 »

Thanks for the replys. I think I'm better off with a framework anyway.

I was leaning towards Kryonet. Does anyone have experience with both Netty and Kryonet?
Offline Conner_

Senior Newbie




~ Java Game Dev ~


« Reply #4 - Posted 2011-09-05 17:38:40 »

Hey! I made a thread over at gamedev about a problem I had with networking. One respons I got said that Java nio has bugs that has not been fixed. Is this really true? I find it strange, but he sounded pretty sure. Take a look: http://www.gamedev.net/topic/604811-how-common-is-data-errors-in-tcp/

Also, I started thinking about using some sort of networking library instead. I want to make an MMO that can support a few hunderd players, and I want to use TCP. I want something that just works so that I can get on with my game. I have looked a bit at Mina, and it seems nice. Any tips or suggestions?

My first post here :p

I've worked on RuneScape private servers before, and I'm currently working on a Minecraft server implementation, much like CraftBukkit. What I've found is that, no matter how hard you try, using libraries built on top of NIO isn't what I want. I much prefer the ability to make it as lightweight and controllable as possible: that means, I like to just use my own implementation of the java.nio package. That goes without saying that Netty/MINA/etc. are bad, but I found myself uncomfortable with trying to "master" the usage of them at the cost of possibly using them wrong.

I looked up "java nio server example" on Google and found an even better one. I can't link right now but you can try it yourself! I believe it was the fourth result on Google.

Being paranoid of bugs is quite OK -- it's understandable. However, I can assure you that I've used to java.nio lib as it is plenty of times and have yet to encounter and sort of error that was caused by the API and not by me messing something up.

Find me on GitHub: connergdavis
My current project is called Obsidian Framework and is a private Minecraft server application used to play Multiplayer.
Offline Nate

« JGO Bitwise Duke »


Medals: 158
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #5 - Posted 2011-09-06 08:42:36 »

Thanks for the replys. I think I'm better off with a framework anyway.

I was leaning towards Kryonet. Does anyone have experience with both Netty and Kryonet?

KryoNet is my project. Netty is more widely used, so had more testing and has been deployed in production more. KryoNet probably has a much easier to use API, so easy that maybe you would save time by starting with KryoNet and switching if it became an issue. If you did use Netty, you could still use Kryo, the serialization portion of KryoNet, but you'd have to dive into Netty and wire it up.

KryoNet has been used by JGO's Hsaka:
http://www.ttafo.com/afo.html
He says it has scaled to several hundred players.

Offline Hsaka
« Reply #6 - Posted 2011-09-06 12:42:36 »

My online game (http://www.ttafo.com/afo.html) has used KryoNet for almost 2 years now without any problems. Recently I ported both the client and the server to Netty mainly because I wanted to see how much my tiny server machine would scale. Unfortunately, I had to revert to the KryoNet version of the server and client after a day or so because a bunch of consistency problems, connection problems etc. started occurring as more people came online. (Probably my fault though, might have missed something in the docs..)

IMHO KryoNet is much easier to use and will get your project up and running quickly. The only downside for me is that the client must also use KryoNet, which means my J2ME version of AFO (JavaME is still alive in my market) can't talk to the same server as the PC version without some hacking around..
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (37 views)
2014-12-15 09:26:44

Mr.CodeIt (31 views)
2014-12-14 19:50:38

BurntPizza (62 views)
2014-12-09 22:41:13

BurntPizza (99 views)
2014-12-08 04:46:31

JscottyBieshaar (60 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (77 views)
2014-11-29 21:32:03

toopeicgaming1999 (138 views)
2014-11-26 15:22:04

toopeicgaming1999 (127 views)
2014-11-26 15:20:36

toopeicgaming1999 (38 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!