Berkeley CSUA MOTD:Entry 39136
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/07/10 [General] UID:1000 Activity:popular
7/10    

2005/8/16-20 [Computer/SW/Languages/Java] UID:39136 Activity:nil
8/16    I'm looking to write a Java app which initiates and maintains hundreds
        of simultaneous, low-bandwidth HTTP connections.  The prevailing
        answer for simultaneous HTTP connections seems to be use the
        HttpURLConnection class and one thread per connection.  I'm wondering
        if there's a better way, like maybe some way to have buffered reads
        and writes from low-level sockets using only a pair or I/O threads.
        Is this possible in Java or do I have to use something like a thread
        pool?
        \_ Since Java 1.4, you are supposed to be able to use something
           equivalent to select(), as you would with BSD sockets. It's
           all in the java.nio package:
                http://java.sun.com/j2se/1.4.2/docs/guide/nio
           \_ Thanks! -op
2025/07/10 [General] UID:1000 Activity:popular
7/10    

You may also be interested in these entries...
2013/4/29-5/18 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:54665 Activity:nil
4/29    Why were C and Java designed to require "break;" statements for a
        "case" section to terminate rather than falling-through to the next
        section?  99% of the time poeple want a "case" section to terminate.
        In fact some compilers issue warning if there is no "break;" statement
        in a "case" section.  Why not just design the languages to have
        termination as the default behavior, and provide a "fallthru;"
	...
2013/5/1-18 [Computer/SW/Languages/Java, Computer/Theory] UID:54669 Activity:nil
5/1     What's the difference between CS and Computer Engineering?
        http://holykaw.alltop.com/top-ten-paying-degrees-for-college-graduates
        \_ One is science and the other is engineering.
        \_ From http://en.wikiquote.org/wiki/Computer_science
           'A folkloric quotation ... states that "computer science is no more
           about computers than astronomy is about telescopes."  The design
	...
2013/3/5-26 [Computer/SW/Languages/Java] UID:54618 Activity:nil
3/5     Three emergency Java updates in a month. Why do I have a feeling
        that the third one won't be the last one?
        \_ Bingo!
	...
2012/12/18-2013/1/24 [Computer/SW/Languages/Perl] UID:54561 Activity:nil
12/18   Happy 25th birthday Perl, and FUCK YOU Larry Wall for fucking up
        the computer science formalism that sets back compilers development
        back for at least a decade:
        http://techcrunch.com/2012/12/18/print-happy-25th-birthday-perl
        \_ I tried to learn Perl but was scared away by it.  Maybe scripting
           lanauages have to be like that in order to work well?
	...
2012/12/4-18 [Computer/SW/Languages/Java] UID:54544 Activity:nil
12/4    Holy cow, everyone around me in Silicon Valley is way beyond
        middle class according to Chinni's definition:
        http://en.wikipedia.org/wiki/American_middle_class
        \_ Let's set our goals higher:
           http://en.wikipedia.org/wiki/Upper_middle_class_in_the_United_States
           \_ How about this one?
	...
2012/10/29-12/4 [Science/Disaster, Computer/SW/Languages/Java, Politics/Domestic/President/Bush] UID:54516 Activity:nil
10/29   Go Away Sandy.
        \_ Sorry, Coursera is performing preventive maintenance for this
           class site ahead of Hurricane Sandy. Please check back in 15 minutes.
           class site ahead of Hurricane Sandy. Please check back in 15
           minutes.
        \_ Bitch.
	...
Cache (2139 bytes)
java.sun.com/j2se/1.4.2/docs/guide/nio -> java.sun.com/j2se/1.4.2/docs/guide/nio/
Documentation Contents The new I/O (NIO) APIs introduced in v 14 provide new features and impr oved performance in the areas of buffer management, scalable network an d file I/O, character-set support, and regular-expression matching. FileOutputStream classes, getChann el methods have been added to return the underlying FileChannel object, and the close methods have been revised to close the underlying channel. RandomAccessFile class, a getChannel method has been added and the close method has been revised to close the underlying channel. The RandomAccessFile constructors now support the mode characters "s" and "d" to allow the specification, at file-open time, of synchronous writes or synchronous-data writes. OutputStreamWriter classes, cons tructors have been added that take a stream and a Charset object, and the getEncoding methods have been revised to return the historical name of the encoding being used. Constructors to InputStreamReader and OutputStreamWriter have been added that take existing CharsetDecoder and CharsetEncoder objects, respectively. The subSequence m ethod has been added, as required by the CharSequence interface that String now implements. Three additional methods have been added: matches, replaceAll, and replaceFirst. IllegalBlockingModeException if the socket has a channel and the channel is in non-blocking mode. The close method now closes the socket's channel, if it has one, and the new getChannel method returns the underlying channel, if any. IllegalBlockingModeException if the socket has a channel and the channel is in non-blocking mode. The getChannel method has been added and close revised, for the same reasons as in DatagramSocket. Socket class, the getInputStream and getOutputStream metho ds have been revised to delegate all I/O operations to the socket's channel, if it has one. IllegalBlockingModeException if the socket has a channel and the channel is in non-blocking mode. The getChannel method has been added and close revised, for the same reasons as in DatagramSocket. Three new functions have been added to the Java Native Interface (JNI) t o support direct buffers.