[問題]如何在ThreadX下寫出多人連線的功能?
開發平台(Platform): (Ex: Win10, Linux, ...)
ThreadX
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
如這個網頁:
http://www.rtos.com/PDFs/NetX_User_Guide.pdf
問題(Question):
我想要在ThreadX的平台上寫一個TCP Server
而且這個TCP Server它可以同時讓多個Client同時連進來.
我參考的API如上述網址的描述.
但是我發現TCP Server一旦跟第一個client建立好連線之後,
就變成了ESTABLISHED的狀態.
然後第二個client就無法跟它建立連線了, 除非第一個client斷線.
如果建立多個socket, 的確可以讓整支程式跟多個client互動,
但是這些socket他們佔用的port不可能一樣.
而我希望的是: 我的程式能像SSH server或FTP server,
只用一個port就可以同時幫很多client連線.
我知道NetX BSD的API可以達到我期望的效果,
但是...我工作上使用的codebase, 它的NetX BSD支援的太少,
連errno都沒有支援, 而且只有支援Non-blocking模式.
所以我就沒有NetX BSD的API了.
請問....有什麼辦法,
可能讓我的程式 只要用一個port就可以支援多個client的同時連線嗎?
謝謝指教!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 180.177.11.187
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1491299635.A.628.html
噓
04/04 18:15, , 1F
04/04 18:15, 1F
噓
04/04 18:26, , 2F
04/04 18:26, 2F
噓
04/04 19:43, , 3F
04/04 19:43, 3F
→
04/04 19:59, , 4F
04/04 19:59, 4F
→
04/04 20:18, , 5F
04/04 20:18, 5F
→
04/04 20:40, , 6F
04/04 20:40, 6F
推
04/04 22:57, , 7F
04/04 22:57, 7F
→
04/04 22:58, , 8F
04/04 22:58, 8F
→
04/04 22:58, , 9F
04/04 22:58, 9F
→
04/04 22:59, , 10F
04/04 22:59, 10F
推
04/04 23:01, , 11F
04/04 23:01, 11F
→
04/04 23:02, , 12F
04/04 23:02, 12F
→
04/04 23:07, , 13F
04/04 23:07, 13F
→
04/04 23:08, , 14F
04/04 23:08, 14F
推
04/04 23:16, , 15F
04/04 23:16, 15F
推
04/04 23:37, , 16F
04/04 23:37, 16F
推
04/04 23:44, , 17F
04/04 23:44, 17F
→
04/04 23:44, , 18F
04/04 23:44, 18F
→
04/05 00:06, , 19F
04/05 00:06, 19F
→
04/05 03:57, , 20F
04/05 03:57, 20F
推
04/05 07:09, , 21F
04/05 07:09, 21F
→
04/05 07:09, , 22F
04/05 07:09, 22F
→
04/05 08:29, , 23F
04/05 08:29, 23F
→
04/05 08:30, , 24F
04/05 08:30, 24F
→
04/05 08:31, , 25F
04/05 08:31, 25F
→
04/05 10:22, , 26F
04/05 10:22, 26F
→
04/05 10:32, , 27F
04/05 10:32, 27F
→
04/05 10:33, , 28F
04/05 10:33, 28F
→
04/05 10:33, , 29F
04/05 10:33, 29F
→
04/05 10:33, , 30F
04/05 10:33, 30F
推
04/05 12:07, , 31F
04/05 12:07, 31F
→
04/05 23:27, , 32F
04/05 23:27, 32F
→
04/05 23:28, , 33F
04/05 23:28, 33F
推
04/05 23:48, , 34F
04/05 23:48, 34F
→
04/05 23:49, , 35F
04/05 23:49, 35F
推
04/06 00:22, , 36F
04/06 00:22, 36F
→
04/06 00:45, , 37F
04/06 00:45, 37F
→
04/06 00:45, , 38F
04/06 00:45, 38F
→
04/06 00:46, , 39F
04/06 00:46, 39F
→
04/06 00:46, , 40F
04/06 00:46, 40F
→
04/06 00:46, , 41F
04/06 00:46, 41F
→
04/06 00:46, , 42F
04/06 00:46, 42F
→
04/06 00:47, , 43F
04/06 00:47, 43F
→
04/06 00:47, , 44F
04/06 00:47, 44F
→
04/06 00:47, , 45F
04/06 00:47, 45F
→
04/06 00:47, , 46F
04/06 00:47, 46F
→
04/06 00:47, , 47F
04/06 00:47, 47F
→
04/06 00:48, , 48F
04/06 00:48, 48F
→
04/06 00:48, , 49F
04/06 00:48, 49F
→
04/06 00:48, , 50F
04/06 00:48, 50F
→
04/06 00:48, , 51F
04/06 00:48, 51F
→
04/06 00:48, , 52F
04/06 00:48, 52F
→
04/06 00:49, , 53F
04/06 00:49, 53F
→
04/06 00:49, , 54F
04/06 00:49, 54F
→
04/06 00:49, , 55F
04/06 00:49, 55F
→
04/06 00:49, , 56F
04/06 00:49, 56F
推
04/06 01:57, , 57F
04/06 01:57, 57F
推
04/06 07:03, , 58F
04/06 07:03, 58F
→
04/06 07:04, , 59F
04/06 07:04, 59F
→
04/06 07:04, , 60F
04/06 07:04, 60F
→
04/06 07:06, , 61F
04/06 07:06, 61F
→
04/06 07:07, , 62F
04/06 07:07, 62F
推
04/06 08:01, , 63F
04/06 08:01, 63F
噓
04/08 10:12, , 64F
04/08 10:12, 64F
→
04/08 10:13, , 65F
04/08 10:13, 65F
→
04/08 10:13, , 66F
04/08 10:13, 66F
→
04/08 10:14, , 67F
04/08 10:14, 67F
→
04/08 10:14, , 68F
04/08 10:14, 68F
→
04/08 10:14, , 69F
04/08 10:14, 69F
→
04/08 10:15, , 70F
04/08 10:15, 70F
→
04/08 10:15, , 71F
04/08 10:15, 71F
推
04/08 11:47, , 72F
04/08 11:47, 72F
→
04/08 11:49, , 73F
04/08 11:49, 73F
→
04/08 11:53, , 74F
04/08 11:53, 74F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章