Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (762)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (847)
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  
  NIO only sends data one way  (Read 1704 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Posted 2003-12-17 21:09:55 »

(Imagine a really big post here, explaining how I could only get a channel that sent data one way. Then imagine me kicking myself as I realised my mistake while typing the last sentance.)

So instead I'll just ask- why do we need to use a selector to write to a channel? Whats wrong with just calling channel.write(byteBuffer) and letting it get on with it? BlahBlah's tutorial on the wiki just mentions that you need to use the selector to tell it to 'send more data'. Doesn't it have an internal buffer anyway?

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Jeff

JGO Coder

Got any cats?

« Reply #1 - Posted 2003-12-17 22:26:42 »


Don't sweat it.  We have a term for that in my old group at Sun.  We called it the "cardboard programmer."  Sometimes you just need someone to stand there like a cut out while you explain the problem and the answer drops right out Smiley

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!
Offline elias

Senior Devvie

« Reply #2 - Posted 2003-12-18 06:22:10 »

I'm not sure that I understand your question correctly, but if you're asking why a Selector is nescessary to do non-blocking writes ala a normal Socket OutputStream, I'd say it's because no matter how large the internal buffer is and how fast the underlying network link is, you can always fill the buffers if you want. Therefore, the Selector is there to notify you when the buffers/network can take more data. Furthermore, Selectors are crucial when dealing with thousands of sockets in a scalable way.

- elias

Pages: [1]
  ignore  |  Print  

EgonOlsen (361 views)
2018-06-10 19:43:48

EgonOlsen (363 views)
2018-06-10 19:43:44

EgonOlsen (302 views)
2018-06-10 19:43:20

DesertCoockie (539 views)
2018-05-13 18:23:11

nelsongames (867 views)
2018-04-24 18:15:36

nelsongames (849 views)
2018-04-24 18:14:32

ivj94 (1301 views)
2018-03-24 14:47:39

ivj94 (422 views)
2018-03-24 14:46:31

ivj94 (1085 views)
2018-03-24 14:43:53

Solater (433 views)
2018-03-17 05:04: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 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‑
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!