[问题] 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