Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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  
  Need Advice on Java Networking Book  (Read 1535 times)
0 Members and 1 Guest are viewing this topic.
Offline nickdotjava

Junior Duke




I have fallen to the dark side.  I'm using DX9


« Posted 2003-05-20 21:38:07 »

I'm currently writing server software for a game that has chatrooms, and allows users to start games from within the server.  I need a book that explains how to transmit data from computer to computer.  I'm currently looking at the O'Reilly book entitled "Java Network Programming."  Any advice?

-Nick

"Oh ya, that's trivial.  I should have it done in an hour."
Offline leknor

Junior Duke




ROCK!!!


« Reply #1 - Posted 2003-05-21 01:14:59 »

If you feel confident enough to skip past begginer books then the author to Java NIO has been helpful when I emailed him so I feel compelled to plug his book. Also, for a very large number of connections NIO is the only way to go.

If I was writting a chat feature I'd base the protcol on what is known of the AIM protocol. It's been proven to be a solid and flexiable design and I'm kind fond of the design myself.

As for code, you'd need to keep a java.util.Set of all logged in users to allow user to user messages. Then you'd need a Set for all rooms and each room would need to keep a Set of the users in that room so that messages to a room can be broadcast to each user.

HTH
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #2 - Posted 2003-05-23 17:54:51 »

Quote
If you feel confident enough to skip past begginer books then the author to Java NIO has been helpful when I emailed him so I feel compelled to plug his book. Also, for a very large number of connections NIO is the only way to go.


What do you think of the book? Personally, I'm interested in the "multiplexing NIO" chapter - how advanced it is, what topics it covers, etc. All existing resources are too basic (as noted in the thread on NIO which we've both been quite active in Grin).

malloc will be first against the wall when the revolution comes...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline leknor

Junior Duke




ROCK!!!


« Reply #3 - Posted 2003-05-24 00:05:31 »

Quote
I'm interested in the "multiplexing NIO" chapter - how advanced it is, what topics it covers, etc.
That chapeter is available online: http://www.oreilly.com/catalog/javanio/

Here is a quote that is relevent to our other long thread but I'm not gonna make another post just for it. From page 144 of the Java NIO book:
Quote
For the first scenario, in which you want to bring more threads into play to service channels,resist the urge to use multiple selectors.Performing readiness selection on large numbers of channels is not expensive;most of the work is done by the underlying operating system. Maintaining multiple selectors and randomly assigning channels to one of them is not a satisfactory solution to this problem.It simply makes smaller versions of the same scenario.

A better approach is to use one selector for all selectable channels and delegate the servicing of ready channels to other threads.You have a single point to monitor channel readiness and a decoupled pool of worker threads to handle the incoming data. The thread pool size can be tuned (or tune itself,dynamically)according to deployment conditions. Management of selectable channels remains simple,and simple is good.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #4 - Posted 2003-05-24 09:39:37 »

Quote

That chapeter is available online: http://www.oreilly.com/catalog/javanio/

Here is a quote that is relevent to our other long thread but I'm not gonna make another post just for it. From page 144 of the Java NIO book:


Thanks. Yeah, I'd love to use just one selector, but the claim that it's easier this way is rubbish. You have a load of extra complexity if you don't at least split into different selectors for different interest sets; c.f. the SEDA resource - it really is a lot easier to program that way. I'm reasonably confident that minor changes in the nio API's could change things so that the book's claim was more accurate. Once nio works properly (still some major bugs on a few platforms), perhaps Sun will make moves to make it a bit easier to use - at the moment, ASSUMING the bugs were fixed, it's a bit like pointers: very powerful, hard to understand until you've used it a lot, and easy to make mistakes that are very hard to debug.

PS I'm still hoping to look at your code from that other thread in a lot more detail, but still too overworked for the time being Sad

malloc will be first against the wall when the revolution comes...
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.

Longarmx (41 views)
2014-10-17 03:59:02

Norakomi (33 views)
2014-10-16 15:22:06

Norakomi (26 views)
2014-10-16 15:20:20

lcass (30 views)
2014-10-15 16:18:58

TehJavaDev (59 views)
2014-10-14 00:39:48

TehJavaDev (60 views)
2014-10-14 00:35:47

TehJavaDev (50 views)
2014-10-14 00:32:37

BurntPizza (66 views)
2014-10-11 23:24:42

BurntPizza (38 views)
2014-10-11 23:10:45

BurntPizza (80 views)
2014-10-11 22:30:10
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!