Exemplo n.º 1
0
func (c *Client) tellServError(err error) error {
	frame := ctrl.WebSocketControlFrame{
		Type:    ctrl.Msg_Sys_Err,
		Index:   0,
		Content: err.Error(),
	}
	return c.webSocket.WriteString(frame.Bytes())
}
Exemplo n.º 2
0
func (c *wsClient) tellClientSetConfig(svr string) error {
	frame := ctrl.WebSocketControlFrame{
		Type:    ctrl.Msg_Set_Config,
		Index:   0,
		Content: svr,
	}
	return c.websocket.WriteString(frame.Bytes())
}
Exemplo n.º 3
0
func (c *Client) telServConfig() error {
	frame := ctrl.WebSocketControlFrame{
		Type:    ctrl.Msg_Get_Config,
		Index:   0,
		Content: pConfig.LocalHostServ,
	}
	return c.webSocket.WriteString(frame.Bytes())
}