[問題] Error 98, 'Address already in use'

看板Linux作者 (.)時間12年前 (2013/03/06 04:50), 編輯推噓0(003)
留言3則, 2人參與, 最新討論串1/1
OS: Ubuntu 11.0 想在Apache2跑html5 我參考了幾篇文章 採用了python websocket http://maddemcode.com/web/websockets-and-pywebsocket-quick-dirty-playground/ https://code.google.com/p/pywebsocket/ 可是當我執行 $ sudo python standalone.py --log-level debug 確出現 error(98, 'Address already in use') 因此我用netstat 確定沒有人使用port 12345 $ netstat -ln | grep ':12345 ' 然後再次執行 $ sudo python standalone.py -p 12345 --log-level debug 確依然出現error(98, 'Address already in use') 請問還有什麼方式能幫助我解這問題嗎? thx -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 204.96.168.3

03/06 07:08, , 1F
python不熟,我以C來做示意,你的socket要設SO_REUSEADDR
03/06 07:08, 1F

03/06 07:08, , 2F
google一下那個常數會有一堆資料
03/06 07:08, 2F

03/09 08:14, , 3F
thx, I'll try it out
03/09 08:14, 3F
文章代碼(AID): #1HDbgLov (Linux)