1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-30 05:55:20 -05:00

use stream instead of raw chan

This commit is contained in:
v2ray
2016-04-18 18:44:10 +02:00
parent 42b8dbe871
commit 7407c8d561
25 changed files with 217 additions and 188 deletions

View File

@@ -42,13 +42,14 @@ func (this *InboundConnectionHandler) Communicate(packet v2net.Packet) error {
writeFinish.Lock()
go func() {
v2io.RawReaderToChan(input, this.ConnInput)
close(input)
v2io.Pipe(v2io.NewAdaptiveReader(this.ConnInput), input)
input.Close()
readFinish.Unlock()
}()
go func() {
v2io.ChanToRawWriter(this.ConnOutput, output)
v2io.Pipe(output, v2io.NewAdaptiveWriter(this.ConnOutput))
output.Release()
writeFinish.Unlock()
}()