@@ -26,7 +26,7 @@ import { LogVerbosity } from './constants';
2626import { ServerSurfaceCall } from './server-call' ;
2727import { Deadline } from './deadline' ;
2828import { InterceptingListener , MessageContext , StatusObject , WriteCallback } from './call-interface' ;
29- import { CallEventTracker } from './transport' ;
29+ import { CallEventTracker , Transport } from './transport' ;
3030
3131const TRACER_NAME = 'subchannel_call' ;
3232
@@ -105,24 +105,15 @@ export class Http2SubchannelCall implements SubchannelCall {
105105 // This is populated (non-null) if and only if the call has ended
106106 private finalStatus : StatusObject | null = null ;
107107
108- private disconnectListener : ( ) => void ;
109-
110108 private internalError : SystemError | null = null ;
111109
112110 constructor (
113111 private readonly http2Stream : http2 . ClientHttp2Stream ,
114112 private readonly callEventTracker : CallEventTracker ,
115113 private readonly listener : SubchannelCallInterceptingListener ,
116- private readonly peerName : string ,
114+ private readonly transport : Transport ,
117115 private readonly callId : number
118116 ) {
119- this . disconnectListener = ( ) => {
120- this . endCall ( {
121- code : Status . UNAVAILABLE ,
122- details : 'Connection dropped' ,
123- metadata : new Metadata ( ) ,
124- } ) ;
125- } ;
126117 http2Stream . on ( 'response' , ( headers , flags ) => {
127118 let headersString = '' ;
128119 for ( const header of Object . keys ( headers ) ) {
@@ -475,7 +466,7 @@ export class Http2SubchannelCall implements SubchannelCall {
475466 }
476467
477468 getPeer ( ) : string {
478- return this . peerName ;
469+ return this . transport . getPeerName ( ) ;
479470 }
480471
481472 getCallNumber ( ) : number {
0 commit comments