????java socket???к????????????????????????????????Щ????????????÷???????????????
????1??java socket???????????
??????JDK1.6???????2??????
1 public final static int TCP_NODELAY = 0x0001;
2
3 public final static int SO_BINDADDR = 0x000F;
4
5 public final static int SO_REUSEADDR = 0x04;
6
7 public final static int SO_BROADCAST = 0x0020;
8
9 public final static int IP_MULTICAST_IF = 0x10;
10
11 public final static int IP_MULTICAST_IF2 = 0x1f;
12
13 public final static int IP_MULTICAST_LOOP = 0x12;
14
15 public final static int IP_TOS = 0x3;
16
17 public final static int SO_LINGER = 0x0080;
18
19 public final static int SO_TIMEOUT = 0x1006;
20
21 public final static int SO_SNDBUF = 0x1001;
22
23 public final static int SO_RCVBUF = 0x1002;
24
25 public final static int SO_KEEPALIVE = 0x0008;
26
27 public final static int SO_OOBINLINE = 0x1003;
2??public final static int TCP_NODELAY = 0x0001;
?????????????????????????Nagle???????????????Nagle??

????2.1 Nagle???????????
?????????紫???д??????С????????????????????Ч?????????????????40??????????????????????????????????????????Telnet?????????????Ч?????????μ??Nagle???????????????Ч??????????
????2.2 Nagle???????
???????????????????С???????????????????????????????????????????????????????α???????£?
????if there is new data to send
????if the window size >= MSS and available data is >= MSS
????send complete MSS segment now
????else
????if there is unconfirmed data still in the pipe
????enqueue data in the buffer until an acknowledge is received
????else
????send data immediately
????end if
????end if
????end if
????????MSS?maximum segment size????д????TCP??????????Σ???????TCP?δ?????????????