|  | @@ -121,6 +121,7 @@ func (m *Client) monitor() {
 | 
											
												
													
														|  |  	for {
 |  |  	for {
 | 
											
												
													
														|  |  		select {
 |  |  		select {
 | 
											
												
													
														|  |  		case <-m.ctx.Done():
 |  |  		case <-m.ctx.Done():
 | 
											
												
													
														|  | 
 |  | +			m.sessionManager.Close()
 | 
											
												
													
														|  |  			m.inboundRay.InboundInput().Close()
 |  |  			m.inboundRay.InboundInput().Close()
 | 
											
												
													
														|  |  			m.inboundRay.InboundOutput().CloseError()
 |  |  			m.inboundRay.InboundOutput().CloseError()
 | 
											
												
													
														|  |  			return
 |  |  			return
 | 
											
										
											
												
													
														|  | @@ -302,6 +303,8 @@ func handle(ctx context.Context, s *Session, output buf.Writer) {
 | 
											
												
													
														|  |  func (w *ServerWorker) run(ctx context.Context) {
 |  |  func (w *ServerWorker) run(ctx context.Context) {
 | 
											
												
													
														|  |  	input := w.outboundRay.OutboundInput()
 |  |  	input := w.outboundRay.OutboundInput()
 | 
											
												
													
														|  |  	reader := NewReader(input)
 |  |  	reader := NewReader(input)
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +	defer w.sessionManager.Close()
 | 
											
												
													
														|  |  L:
 |  |  L:
 | 
											
												
													
														|  |  	for {
 |  |  	for {
 | 
											
												
													
														|  |  		select {
 |  |  		select {
 |