示例#1
0
文件: send.go 项目: bsn069/go
func SendMsgWithSMsgHeader(vnetConn net.Conn, vTMsgType bsn_common.TMsgType, byMsg []byte) error {
	byData := bsn_msg.NewMsgWithMsgHeader(vTMsgType, byMsg)

	err := Send(vnetConn, byData)
	if err != nil {
		return err
	}

	return nil
}
示例#2
0
文件: client_user.go 项目: bsn069/go
func (this *SClientUser) SendPb2Client(vTClientId TClientId, msgType bsn_msg_client_echo_server.ECmdEchoServe2Client, iMessage proto.Message) error {
	byMsg, err := proto.Marshal(iMessage)
	if err != nil {
		GSLog.Errorln(err)
		return err
	}

	byData := bsn_msg.NewMsgWithMsgHeader(bsn_common.TMsgType(msgType), byMsg)
	return this.Send2Client(vTClientId, byData)
}