使用Restlet api实现聊天服务

时间:2011-03-29 14:25:54

标签: restlet chatroom

首先,我不太熟悉restlets,刚刚开始。我想实现一个广播聊天室,其中发送消息的客户端将消息广播给所有其他客户端。

   My attempt was to use a resource on the server side where the client would send the message(as a String) using POST. The other clients would constantly have to poll this resource to receive the message. I know this method must be horribly ineffective. 

   I was wondering if there was a better method where a change on the server side(in this case the sending of the string message) would result in the server alerting the clients of this update.

1 个答案:

答案 0 :(得分:0)

使用新的nio连接器,2.1版本中会出现一些问题。在网页中,您可以考虑使用Comet或HTML5网络套接字等技术。

请参阅Restlet的开发人员维基的规范页面:http://wiki.restlet.org/developers/172-restlet/g3/354-restlet.html

亨利