Beispiel #1
0
func (s *Session) ProcessNewDataToServerProxy(rawData []byte) {
	//log.Println("session ProcessNewDataToServerProxy")
	p := udppacket.CreateNewPacket(s.count, rawData, "", s.ModulesCount, s.LOG)
	p.SessionId = s.id
	p.OtherLen = 0
	s.count++
	p.RawDataAddHeader()
	s.sendList.PushBack(p)
}
Beispiel #2
0
/**
 * destroy session
 * -- return empty packet to ack remote proxy
 */
func (s *Session) Destroy(flag bool) *udppacket.Packet {
	if s.C != nil {
		conn := *s.C
		conn.Close()
	}
	if flag {
		data := make([]byte, 96)
		p := udppacket.CreateNewPacket(0, data, "", s.ModulesCount, s.LOG)
		p.SessionId = s.id
		p.RawDataAddHeader()
		return p
	} else {
		return nil
	}
	return nil
}