吉首大学学报(自然科学版)

• 计算机 • 上一篇    下一篇

基于WebSocket的在线围棋对弈软件设计

丁振凡   

  1. (华东交通大学信息工程学院,江西 南昌 330013)
  • 出版日期:2017-07-25 发布日期:2017-08-01
  • 作者简介:丁振凡(1965—),男,江西丰城人,华东交通大学信息工程学院教授,硕士生导师,主要从事云计算、语义Web、计算机辅助教学研究.

Design of Web I-go Game Software Based on WebSocket

DING Zhenfan   

  1. (School of Information Engineering,East China Jiao Tong University,Nanchang 330013,China)
  • Online:2017-07-25 Published:2017-08-01

摘要:

将HTML5和Spring4框架相结合,以在线围棋对弈为例研究了Web实时应用开发技术:采用WebSocket实现了客户浏览器与Web服务器的消息通信;通过HTML5的Canva绘制了围棋画面;基于SockJS连接和STOMP协议,实现了发布/订阅的双向消息传输;针对棋桌选择和对弈界面所涉及的交互过程,讨论了消息主题设计、消息发送及消息内容显示处理的具体方法.该应用开发模式对于Web实时协作应用设计具有较大参考价值.

关键词: HTML5, Spring4, 围棋对弈, WebSocket, canvas, SockJS

Abstract:

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.

Key words: HTML5, Spring4, I-go play, WebSocket, canvas, SockJS

公众号 电子书橱 超星期刊 手机浏览 在线QQ