@@ -6,7 +6,6 @@ import arraybuffers = require('../../arraybuffers/arraybuffers');
66import crypto = require( 'crypto' ) ;
77import linefeeder = require( '../../net/linefeeder' ) ;
88import logging = require( '../../logging/logging' ) ;
9- import promises = require( '../../promises/promises' ) ;
109import queue = require( '../../handler/queue' ) ;
1110
1211// https://github.com/borisyankov/DefinitelyTyped/blob/master/ssh2/ssh2-tests.ts
@@ -209,24 +208,15 @@ export class CloudSocialProvider {
209208 } ) ;
210209 }
211210
212- let numAttempts = 0 ;
213- const connect = ( ) => {
214- log . debug ( 'connection attempt %1...' , ( ++ numAttempts ) ) ;
215- const connection = new Connection ( invite , ( message : Object ) => {
216- this . dispatchEvent_ ( 'onMessage' , {
217- from : makeClientState ( invite . host ) ,
218- // SIGNAL_FROM_SERVER_PEER,
219- message : JSON . stringify ( makeVersionedPeerMessage ( 3002 , message ) )
220- } ) ;
221- } ) ;
222- return connection . connect ( ) . then ( ( ) => {
223- return connection ;
211+ const connection = new Connection ( invite , ( message : Object ) => {
212+ this . dispatchEvent_ ( 'onMessage' , {
213+ from : makeClientState ( invite . host ) ,
214+ // SIGNAL_FROM_SERVER_PEER,
215+ message : JSON . stringify ( makeVersionedPeerMessage ( 3002 , message ) )
224216 } ) ;
225- } ;
226-
227- this . clients_ [ invite . host ] = promises . retryWithExponentialBackoff ( connect ,
228- MAX_CONNECTION_INTERVAL_MS , INITIAL_CONNECTION_INTERVAL_MS ) . then (
229- ( connection :Connection ) => {
217+ } ) ;
218+
219+ this . clients_ [ invite . host ] = connection . connect ( ) . then ( ( ) => {
230220 log . info ( 'connected to zork on %1' , invite . host ) ;
231221
232222 // Fetch the banner, if available, then emit an instance message.
0 commit comments