由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 有人用过异步Socket么?
相关主题
Help: 有大虾在 Applet 中用过 UDP socket 麽?how to transfer data between two sockets
send() vs sendto()Socket Connection refused in high-loaded servers
socket programing server-server怎么通讯?Re: Where can i find this package?
多個Software Engineer 職缺 (转载)求助Java Image Tools or API
【跪求】java applet下怎么执行系统的一个程序?JMS这东西用的多吗?
how to read from a non-return socket stream?纽约附近的兄弟有想一起做个交易系统的吗?
Java 8 stream 可以 代替 do while loop吗?怎么写Re: CORBA 一问
java开发过程中,关于 scalable 的问题,应该有哪些要注意的?Why no JAVA HTTP Stack?
相关话题的讨论汇总
话题: socket话题: stream话题: use话题: nb话题: blocking
进入Java版参与讨论
1 (共1页)
D*********s
发帖数: 555
1
有没有可能non-blocking socket和Stream一起用呢?
还有UDP可以用Stream么?
f*****g
发帖数: 31
2

Yes you can. But it is better using nio. The best, it is
still use tradition Java socket. NB Socket's performance
is too bad.

【在 D*********s 的大作中提到】
: 有没有可能non-blocking socket和Stream一起用呢?
: 还有UDP可以用Stream么?

D*********s
发帖数: 555
3
Where did you get the data saying that NB Socket's performance
is bad? any link please.
You said I can use non-blocking socket along with Stream. Can you
please tell some details?
As I know if you don't use nio, which has select(), you actually
can't use non-blocking socket because busy waiting is a BAD idea.
Did you just refer to this busy waiting when you said NB socket's
performance?

【在 f*****g 的大作中提到】
:
: Yes you can. But it is better using nio. The best, it is
: still use tradition Java socket. NB Socket's performance
: is too bad.

e***g
发帖数: 158
4
short answer: no. no such API/adapter.
middle answer: don't use socket channel, mostly you don't need it,
it just makes your program complicated without visible performance
gain. keep code simple and scalable, put more servers, it's cheap.
long answer: if you do reach some kind of limit and you must use
socket channel. sure you can write your own plumbing and make
adapters of channel->stream, but then you end up with thousands
of threads and defeat the purpose of select(). in this

【在 D*********s 的大作中提到】
: Where did you get the data saying that NB Socket's performance
: is bad? any link please.
: You said I can use non-blocking socket along with Stream. Can you
: please tell some details?
: As I know if you don't use nio, which has select(), you actually
: can't use non-blocking socket because busy waiting is a BAD idea.
: Did you just refer to this busy waiting when you said NB socket's
: performance?

D*********s
发帖数: 555
5
This makes sense. Thanks.

【在 e***g 的大作中提到】
: short answer: no. no such API/adapter.
: middle answer: don't use socket channel, mostly you don't need it,
: it just makes your program complicated without visible performance
: gain. keep code simple and scalable, put more servers, it's cheap.
: long answer: if you do reach some kind of limit and you must use
: socket channel. sure you can write your own plumbing and make
: adapters of channel->stream, but then you end up with thousands
: of threads and defeat the purpose of select(). in this

1 (共1页)
进入Java版参与讨论
相关主题
Why no JAVA HTTP Stack?【跪求】java applet下怎么执行系统的一个程序?
What is good Java software?how to read from a non-return socket stream?
OutofMemoryError: Java Heap SpaceJava 8 stream 可以 代替 do while loop吗?怎么写
JBoss UDP exceptionjava开发过程中,关于 scalable 的问题,应该有哪些要注意的?
Help: 有大虾在 Applet 中用过 UDP socket 麽?how to transfer data between two sockets
send() vs sendto()Socket Connection refused in high-loaded servers
socket programing server-server怎么通讯?Re: Where can i find this package?
多個Software Engineer 職缺 (转载)求助Java Image Tools or API
相关话题的讨论汇总
话题: socket话题: stream话题: use话题: nb话题: blocking