コード例 #1
0
ファイル: client_proc.go プロジェクト: cmbug/flashchat
func (this *Client) ConnectToMsgServer() (err error) {
	this.keysession, err = libnet.ConnectTimeout(this.cfg.Server_Network, this.cfg.KeyServer_Addr, time.Second*time.Duration(this.cfg.ConnectTimeout), libnet.NewDefCodec(1, 1024, 1024, libnet.BigEndian, this.keycodec))
	if err != nil {
		return err
	}
	this.session, err = libnet.ConnectTimeout(this.cfg.Server_Network, this.cfg.Server_Addr, time.Second*time.Duration(this.cfg.ConnectTimeout),
		libnet.NewDefCodec(2, 1024*1024, 1024, libnet.BigEndian, this.customcodec))
	return err
}
コード例 #2
0
ファイル: msgserver_proc.go プロジェクト: cmbug/flashchat
func (this *MsgServer) ConnectToServer() (err error) {
	this.wsSession, err = libnet.ConnectTimeout(this.cfg.Server_Network, this.cfg.Server_Addr, time.Second*time.Duration(this.cfg.ConnectTimeout), libnet.NewDefCodec(2, 2*1024, 2*1024, libnet.BigEndian, this.customCodec))
	return err
}
コード例 #3
0
ファイル: client_proc.go プロジェクト: cmbug/flashchat
func (this *Client) ConnectToGatewayServer() (err error) {
	this.session, err = libnet.ConnectTimeout(this.cfg.Server_Network, this.cfg.Server_Addr, time.Second*time.Duration(this.cfg.ConnectTimeout),
		libnet.NewDefCodec(1, 1024, 1024, libnet.BigEndian, this.keycodec))
	return err
}