コード例 #1
0
// NewReaderStream returns a new ReaderStreamWrapper object.
func NewReaderStreamWrapper() ReaderStreamWrapper {
	r := ReaderStreamWrapper{
		ReaderStream: tcpreader.NewReaderStream(),
		Reassemblies: make([]ReassemblyInfo, 0),
	}
	//	r.ReaderStream.ReaderStreamOptions.LossErrors = true
	return r
}
コード例 #2
0
ファイル: main.go プロジェクト: RunxiaWan/oganization
func (h *DNSStreamFactory) New(net, transport gopacket.Flow) tcpassembly.Stream {
	hstream := &dnsStream{
		net:       net,
		transport: transport,
		r:         tcpreader.NewReaderStream(),
	}
	go hstream.run(h.normal) // Important... we must guarantee that data from the reader stream is read.
	// ReaderStream implements tcpassembly.Stream, so we can return a pointer to it.
	return &hstream.r
}
コード例 #3
0
func NewHttpResponseStream(httpRequest *HttpRequestStream, wg *sync.WaitGroup) *HttpResponseStream {
	//
	stream := HttpResponseStream{}
	stream.reader = tcpreader.NewReaderStream()
	stream.wg = wg
	stream.httpRequest = httpRequest

	//
	go stream.start()

	//
	return &stream
}
コード例 #4
0
func NewHttpRequestStream(wg *sync.WaitGroup) *HttpRequestStream {
	//
	stream := HttpRequestStream{}
	stream.reader = tcpreader.NewReaderStream()
	stream.wg = wg

	//
	logHRSCount++
	stream.wg.Add(1)

	//
	go stream.start()
	return &stream
}
コード例 #5
0
ファイル: stream.go プロジェクト: jamessanford/rtmp-debug
func (w *rtmpStreamWrapper) New(net, tcp gopacket.Flow) tcpassembly.Stream {
	// TODO all glog messages in the rtmpStream should include this prefix:
	//	prefix := fmt.Sprintf("%s ", tcp)  FIXME
	s := &rtmpStream{
		track:     make(map[uint32]*RTMPMessage),
		finalizer: &MessageFinalizer{r: w.output},
		chunkSize: 128,
	}

	w.outer.Add(1)
	r := tcpreader.NewReaderStream()
	go s.parseStream(w.outer, &r)
	return &r
}