Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (744)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (825)
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  
  Is NIO worth it?  (Read 3052 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel


Medals: 57
Projects: 11


Monkey for a head


« Posted 2005-01-06 12:38:16 »

Last time I tried some NIO networking ('bout over a year ago) I had a hell of a difficult time getting the code to work reliably, and the whole API seemed more than a tad fragile (poor docs, odd behaviour, much weirdness).

Given that I'm now looking at some networking code again, is it worth bothering with NIO? Regular threaded network code with sockets is (IMHO) dead easy in comparison and I never had any of the weirdness. And with my 'net access being sporadic at best hunting down tutorials and docs on NIO is going to be a pain.

I only really want a basic message passing system, with 2-8 players. Methinks it would be much easier to ignore it and possibly upgrade later...

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #1 - Posted 2005-01-06 12:43:00 »

For 2-8 players, I'd probably ignore it as well. Most OSes these days have fairly good threading models, so the difference shouldn't be too substantial. If you want to have 15+ concurrent clients, then I'd say it's probably time to look into NIO. Either that or buy a Solaris machine for your server. :-) (Solaris has one of the best threading libraries, period, and can handle thousands of threads without even blinking an eye.)

Java Game Console Project
Last Journal Entry: 12/17/04
Offline Tomas

Junior Devvie




Agency9


« Reply #2 - Posted 2005-01-06 22:07:15 »

The real benefit of NIO is when you get heavy load, like hell of a lot small packages or fewer packages but big once.  .... and you probably end up with both pretty soon Wink

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

JGO Coder


Medals: 1


http://t-machine.org


« Reply #3 - Posted 2005-01-06 23:45:27 »

IMHO the "real benefit" is that its considerably easier to program, in terms of program design, once you're comfortable with it.

Although I tried writing some NIO servers *fast* not so long ago, and realised that Sun hasn't provided enough high-level constructs. One of the things I plan to release with my book is some open-source convenience constructs to make it easier to get new NIO servers up and running quickly.

Although I'm not sure how yet, without just stealing stuff from the GE Wink.

malloc will be first against the wall when the revolution comes...
Offline Herkules

Senior Devvie




Friendly fire isn't friendly!


« Reply #4 - Posted 2005-01-07 06:04:24 »

A package within HeadQuarter called 'ObjectBus' also is a convenience layer above NIO. There is also an tutorial written by a user (can check it into CVS this evening)

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #5 - Posted 2005-01-07 15:08:00 »

I *promise* I shall try HQ next time I need a quick-to-write NIO server Grin. It just doesn't usually occur to me in the minutes I have avaliable to decide how to do it.

malloc will be first against the wall when the revolution comes...
Offline Herkules

Senior Devvie




Friendly fire isn't friendly!


« Reply #6 - Posted 2005-01-10 07:00:54 »

Oh no, please don't! Your experience level is far above HQ! *YOU* should improve it - not use it
Embarrassed

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline vrm

Junior Devvie




where I should sign ?


« Reply #7 - Posted 2005-01-10 07:33:16 »

/me sees Herkules running for complete the Javadoc comments before Blah² start inspecting his code  Grin
Offline Herkules

Senior Devvie




Friendly fire isn't friendly!


« Reply #8 - Posted 2005-01-10 09:22:48 »

lol - exactly!

Its not the JavaDoc. Its more exception handling, thread treatment, notifications, server data distribution schemes...

I'm sure bla³ will encounter excatly the issues of NIO with HeadQuarter as well. And me looking studid.  :-/

Man, FlyingGuns is a too big project for a single person (esp. such a lazy family father like myself). I just cannot manage to polish all APIs. My last action concerned the *build system*, now heading for 3D a bit again.

Then physics, then architecture, then databases, then gameplay, then networking again....

*VOLUNTEERS NEEDED*!!!!!

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #9 - Posted 2005-01-10 09:27:25 »

Quote
Oh no, please don't! Your experience level is far above HQ! *YOU* should improve it - not use it
Embarrassed


Yeah, but the issue is that a full-fat "efficient, powerful, clever" NIO system is not always the right tool, and sometimes a very wrong tool, for the job at hand. If I could, I would use GE code for every piece of networking I ever did ever again, but GE isn't free licensed and drags with it a whole architecture/framework, so that's not tenable Smiley.

And some parts of it are patented, so I can't even legally re-implement them outside of Grex. LOL.

EDIT: which is not to say that HQ is inefficient, but more that the GE stuff aims to be excellent in every dimension at once, whereas HQ is narrower. In theory, given what HQ does, it ought to do it well without much difficulty?

malloc will be first against the wall when the revolution comes...
Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (145 views)
2017-09-30 02:57:34

theagentd (213 views)
2017-09-26 18:23:31

cybrmynd (294 views)
2017-08-02 12:28:51

cybrmynd (284 views)
2017-08-02 12:19:43

cybrmynd (294 views)
2017-08-02 12:18:09

Sralse (287 views)
2017-07-25 17:13:48

Archive (966 views)
2017-04-27 17:45:51

buddyBro (1092 views)
2017-04-05 03:38:00

CopyableCougar4 (1663 views)
2017-03-24 15:39:42

theagentd (1425 views)
2017-03-24 15:32:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
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!