I am writing a multi-threaded socket server. I use nio ServerSocketChannelto receive connections. Then Ii'm reading and writing (in separate streams) to socketChannelusing bufferedreaderand fingerprint. The problem is that it PrintWriterblocks and waits for the command flush(). It blocks the stream until data bufferedreaderis received.
ServerSocketChannel
socketChannel
bufferedreader
PrintWriter
flush()
This means that the receiver is slow. How block I / O works. If you want non-blocking I / O, you are already part of this path since you are already using NIO. Although I really see no reason to use NIO in lock mode at all.
@EJP, -. , , . ( ) , , .
? .
, , . , , . .
, " ", . , . , .
, .
/ , .
JVM. , Java PipeInputStream/PipeOutputStream . ( , , ..)
, JVM, , Buffered* , , /.
Buffered*
Source: https://habr.com/ru/post/1793454/More articles:sdl related error while scrambling application for ARM - c ++Help choose a binding (WCF) - .netStrange receiver / selector errors from numberOfSectionsInTableView iPhone SDK reported by Flurry - objective-cJava: general filter mapping function - javaUsing Zend_Db database connection - zend-frameworkHow to use the functions of MACD R packets? - rAES 128 бит, 192 бит, 256 бит - c++Is there a free .NET library for skinning an application? - user-interfacePut some HTML inside tag? - html Как сказать "Содержит ничего" в jQuery? - jquery All Articles
tag? - html