[問題] CocaHTTPServer Websocket

作者: stero (認真 發呆)   2014-03-26 10:34:35
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,新手提問勿見怪,謝謝.

Links booklink

Contact Us: admin [ a t ] ucptt.com