File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,6 @@ extension ConnectHandler: ChannelInboundHandler {
3535    typealias  OutboundOut  =  ByteBuffer 
3636
3737    func  channelRead( context:  ChannelHandlerContext ,  data:  NIOAny )  { 
38-         if  self . pendingBytes. isEmpty { 
39-             self . connectToServer ( context:  context) 
40-         } 
4138        self . pendingBytes. append ( data) 
4239    } 
4340
@@ -46,6 +43,12 @@ extension ConnectHandler: ChannelInboundHandler {
4643        self . log ? [ metadataKey:  " proxy " ]  =  " \( context. channel. localAddress? . description ??  " none " ) " 
4744        self . log ? [ metadataKey:  " server " ]  =  " \( context. channel. remoteAddress? . description ??  " none " ) " 
4845    } 
46+ 
47+     func  channelActive( context:  ChannelHandlerContext )  { 
48+         self . log? . trace ( " frontend - channel active, connecting to backend " ) 
49+         self . connectToServer ( context:  context) 
50+         context. fireChannelActive ( ) 
51+     } 
4952} 
5053
5154extension  ConnectHandler :  RemovableChannelHandler  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments