diff --git a/transport/internet/kcp/receiving.go b/transport/internet/kcp/receiving.go index 7c10dad5..5024628b 100644 --- a/transport/internet/kcp/receiving.go +++ b/transport/internet/kcp/receiving.go @@ -256,7 +256,7 @@ func (v *ReceivingWorker) Write(seg Segment) error { ackSeg.Conv = v.conn.conv ackSeg.ReceivingNext = v.nextNumber ackSeg.ReceivingWindow = v.nextNumber + v.windowSize - if v.conn.state == StateReadyToClose { + if v.conn.State() == StateReadyToClose { ackSeg.Option = SegmentOptionClose } return v.conn.output.Write(ackSeg)