全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1123
推到 Plurk!
推到 Facebook!

如何取得 local port 是否被佔用.

答題得分者是:disabledman
cwchiang
一般會員


發表:27
回覆:11
積分:7
註冊:2003-06-09

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-05-20 14:05:10 IP:61.56.xxx.xxx 未訂閱
各位先進好, 我想寫傳輸資料的程式, 但是要先查詢電腦上的local port 是否為被佔用的.
disabledman
一般會員


發表:0
回覆:5
積分:6
註冊:2004-02-13

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-05-27 16:46:27 IP:61.220.xxx.xxx 未訂閱
利用 bind() 的成功與否, 不就可以判斷該 PORT 的使用狀況! 生生堂
------
生生堂
sya
一般會員


發表:2
回覆:2
積分:0
註冊:2004-04-19

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-06-02 13:37:13 IP:140.115.xxx.xxx 未訂閱
這是我在help上看到的, 可以參考看看    procedure Bind; Description Bind is used on an unconnected socket to associate the IP and Port of the local host with Handle prior to Connect or Listen operations. If the application does not care what address is assigned to it, it may use a blank IP (''). This allows the protocol stack to assign the Internet address Id_INADDR_ANY, and an any appropriate network interface will be used. If the application does not care what port is assigned to it, it may use Port 0. This allows the protocol stack to assign a unique port to the application with a value between 1024 and 5000. Use SetSockOpt to alter socket-level settings including broadcast, linger, buffering, and Nagle options. Bind will raise an EIdException if the address in IP and Port is already in use.
系統時間:2024-05-16 21:07:18
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!