摘要
将HTML5和Spring4框架相结合,以在线围棋对弈为例研究了Web实时应用开发技术:采用WebSocket实现了客户浏览器与Web服务器的消息通信;通过HTML5的Canva绘制了围棋画面;基于SockJS连接和STOMP协议,实现了发布/订阅的双向消息传输;针对棋桌选择和对弈界面所涉及的交互过程,讨论了消息主题设计、消息发送及消息内容显示处理的具体方法.该应用开发模式对于Web实时协作应用设计具有较大参考价值.
For I-go game software design,the technology is described for real-time application of HTML5 and Spring4 framework. WebSocket is used for the message communication between the client browser and the Web server,and the HTML5 Canva is used for drawing the chess board. With the establishment of SockJS connection and STOMP protocol communication, two-way message transmission based on publishing / subscribing mode is used. For the interactions involved in table choosing and game playing, the message topic designing, message sending and displaying methods are discussed. This research has great reference value for the design of real time Web application.
出处
《吉首大学学报(自然科学版)》
CAS
2017年第4期27-33,共7页
Journal of Jishou University(Natural Sciences Edition)