mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 23:47:07 -05:00
signal when read
This commit is contained in:
parent
ef1d9d24cd
commit
b4ff4c7e75
@ -62,6 +62,7 @@ func (p *pipe) ReadMultiBuffer() (buf.MultiBuffer, error) {
|
|||||||
for {
|
for {
|
||||||
data, err := p.readMultiBufferInternal()
|
data, err := p.readMultiBufferInternal()
|
||||||
if data != nil || err != nil {
|
if data != nil || err != nil {
|
||||||
|
p.writeSignal.Signal()
|
||||||
return data, err
|
return data, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ func WithSizeLimit(limit int32) Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// New creates a new Reader and Writer that connects to each other.
|
||||||
func New(opts ...Option) (*Reader, *Writer) {
|
func New(opts ...Option) (*Reader, *Writer) {
|
||||||
p := &pipe{
|
p := &pipe{
|
||||||
limit: defaultLimit,
|
limit: defaultLimit,
|
||||||
|
Loading…
Reference in New Issue
Block a user