国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

云州泇滴Go+Vue通用后臺(tái)管理項(xiàng)目實(shí)戰(zhàn)

2023-08-22 14:17 作者:bili_67158895267  | 我要投稿

創(chuàng)建WebSocket服務(wù)端程序

1、創(chuàng)建目錄chat并初始化

cd chat go mod init chat

2、增加文件client.go,該文件處理WebSocket客戶端程序。其中serveWebsocket()函數(shù)處理客戶端連接。

package mainimport ( ? ?"bytes" ? ?"log" ? ?"net/http" ? ?"time" ? ?"github.com/gorilla/websocket")const ( ? ?// Time allowed to write a message to the peer. ? ?writeWait = 10 * time.Second ? ?// Time allowed to read the next pong message from the peer. ? ?pongWait = 60 * time.Second ? ?// Send pings to peer with this period. Must be less than pongWait. ? ?pingPeriod = (pongWait * 9) / 10 ? ?// Maximum message size allowed from peer. ? ?maxMessageSize = 512)var ( ? ?newline = []byte{'\n'} ? ?space ? = []byte{' '})



云州泇滴Go+Vue通用后臺(tái)管理項(xiàng)目實(shí)戰(zhàn)的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
象州县| 娄烦县| 临泽县| 东丰县| 岱山县| 乌什县| 昌江| 阿克陶县| 永靖县| 保亭| 长岭县| 修水县| 东乌珠穆沁旗| 昭平县| 阳朔县| 嵩明县| 景泰县| 花莲市| 涞水县| 托克逊县| 泽普县| 延安市| 开江县| 恩平市| 隆化县| 化隆| 琼结县| 洪江市| 黄山市| 内黄县| 镇雄县| 太康县| 克东县| 龙门县| 余姚市| 恩施市| 赤峰市| 峨眉山市| 海南省| 满洲里市| 昌都县|