一次 send 可能被多次 recv, 多次 send 可能被一次 recv 所以buffer開多大能不能一次收完, 反而不是重點 像 telnet 這種, 就是有資料就收, 沒資料就卡.. 有些protocol是會有 header 的, 所以可以用 header裡的length去決定還要收多少 才會是一個完整的boundary 多收到的就留著, 要 ... The first step to programming with windows sockets (A.K.A "Winsock") is starting up the Winsock API. There are two versions of Winsock; version one is the older, limited version; and version 2 is the latest edition and is therefore the version we prefer to specify. Collapse Copy Code #define SCK_VERSION1 0x0101 I tried with 2000 bytes and it worked fine now. Didn't change the code for that. However, it fails for bigger data, say 9000 bytes. Also, when it hangs, I see "The thread 'Win32 Thread' (0x1bc0) has exited with code 0 (0x0)" on the output window of server app. – pree Apr 4 '13 at 23:06 Industrial & lab equipment; Electrical equipment & supplies; Power generators; Agilent Technologies; N5181A/82A; User manual; Agilent Technologies | N5181A/82A | User manual | Agilent Technologies N5181A/82A User's Manual