|  | @@ -188,7 +188,7 @@ type Connection struct {
 | 
											
												
													
														|  |  	receivingWorker *ReceivingWorker
 |  |  	receivingWorker *ReceivingWorker
 | 
											
												
													
														|  |  	sendingWorker   *SendingWorker
 |  |  	sendingWorker   *SendingWorker
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -	output *BufferedSegmentWriter
 |  | 
 | 
											
												
													
														|  | 
 |  | +	output SegmentWriter
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	dataUpdater *Updater
 |  |  	dataUpdater *Updater
 | 
											
												
													
														|  |  	pingUpdater *Updater
 |  |  	pingUpdater *Updater
 | 
											
										
											
												
													
														|  | @@ -208,7 +208,7 @@ func NewConnection(conv uint16, sysConn SystemConnection, recycler internal.Conn
 | 
											
												
													
														|  |  		dataInput:    make(chan bool, 1),
 |  |  		dataInput:    make(chan bool, 1),
 | 
											
												
													
														|  |  		dataOutput:   make(chan bool, 1),
 |  |  		dataOutput:   make(chan bool, 1),
 | 
											
												
													
														|  |  		Config:       config,
 |  |  		Config:       config,
 | 
											
												
													
														|  | -		output:       NewSegmentWriter(sysConn, config.GetMtu().GetValue()-uint32(sysConn.Overhead())),
 |  | 
 | 
											
												
													
														|  | 
 |  | +		output:       NewSegmentWriter(sysConn),
 | 
											
												
													
														|  |  		mss:          config.GetMtu().GetValue() - uint32(sysConn.Overhead()) - DataSegmentOverhead,
 |  |  		mss:          config.GetMtu().GetValue() - uint32(sysConn.Overhead()) - DataSegmentOverhead,
 | 
											
												
													
														|  |  		roundTrip: &RoundTripInfo{
 |  |  		roundTrip: &RoundTripInfo{
 | 
											
												
													
														|  |  			rto:    100,
 |  |  			rto:    100,
 | 
											
										
											
												
													
														|  | @@ -542,7 +542,6 @@ func (v *Connection) flush() {
 | 
											
												
													
														|  |  	if v.State() == StateTerminating {
 |  |  	if v.State() == StateTerminating {
 | 
											
												
													
														|  |  		log.Debug("KCP|Connection: #", v.conv, " sending terminating cmd.")
 |  |  		log.Debug("KCP|Connection: #", v.conv, " sending terminating cmd.")
 | 
											
												
													
														|  |  		v.Ping(current, CommandTerminate)
 |  |  		v.Ping(current, CommandTerminate)
 | 
											
												
													
														|  | -		v.output.Flush()
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  		if current-atomic.LoadUint32(&v.stateBeginTime) > 8000 {
 |  |  		if current-atomic.LoadUint32(&v.stateBeginTime) > 8000 {
 | 
											
												
													
														|  |  			v.SetState(StateTerminated)
 |  |  			v.SetState(StateTerminated)
 | 
											
										
											
												
													
														|  | @@ -564,9 +563,6 @@ func (v *Connection) flush() {
 | 
											
												
													
														|  |  	if current-atomic.LoadUint32(&v.lastPingTime) >= 3000 {
 |  |  	if current-atomic.LoadUint32(&v.lastPingTime) >= 3000 {
 | 
											
												
													
														|  |  		v.Ping(current, CommandPing)
 |  |  		v.Ping(current, CommandPing)
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -	// flash remain segments
 |  | 
 | 
											
												
													
														|  | -	v.output.Flush()
 |  | 
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  func (v *Connection) State() State {
 |  |  func (v *Connection) State() State {
 |