[問題] CocaHTTPServer Websocket
https://github.com/robbiehanson/CocoaHTTPServer
網址為新手宅宅我找到的 websocket server example,
不知道有無用過這個api的前輩可以請教一下,
整個範例跑起來都沒問題,我想要改成可以在view controller底下發送跟接收
接收目前不會,還是整個搞不懂協定跟委派,
但是發送的部分我想到說 這樣寫:
int websocketnum = [httpServer numberOfWebSocketConnections];
if(websocketnum>0)
{
for (MyWebSocket *WS in httpServer.webSockets) {
[WS sendMessage:@"send test success"];
}
}
for 回圈可以進入,但是就是送出訊息的那行會跳過不執行
請問有前輩知道嗎?
剛進入mac,新手提問勿見怪,謝謝.
--
→
04/08 14:31,
04/08 14:31
→
04/08 14:31,
04/08 14:31
推
04/08 14:32,
04/08 14:32
→
04/08 14:34,
04/08 14:34
噓
04/08 14:38,
04/08 14:38
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.70.74.197
※ 文章網址: http://www.ptt.cc/bbs/MacDev/M.1395801291.A.4EA.html
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章