File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ export default class DeviceClient {
161
161
* `jdwp:<process pid>`
162
162
* @returns true
163
163
*/
164
- public forward ( local : string , remote : string ) : Bluebird < boolean > {
164
+ public forward ( local : string , remote : string ) : Bluebird < number > {
165
165
return this . connection ( ) . then ( ( conn ) => new ForwardCommand ( conn ) . execute ( this . serial , local , remote ) ) ;
166
166
}
167
167
Original file line number Diff line number Diff line change @@ -2,16 +2,18 @@ import Command from '../../command';
2
2
import Protocol from '../../protocol' ;
3
3
import Bluebird from 'bluebird' ;
4
4
5
- export default class ForwardCommand extends Command < boolean > {
6
- execute ( serial : string , local : string , remote : string ) : Bluebird < boolean > {
5
+ export default class ForwardCommand extends Command < number > {
6
+ execute ( serial : string , local : string , remote : string ) : Bluebird < number > {
7
7
this . _send ( `host-serial:${ serial } :forward:${ local } ;${ remote } ` ) ;
8
8
return this . parser . readAscii ( 4 ) . then ( ( reply ) => {
9
9
switch ( reply ) {
10
10
case Protocol . OKAY :
11
11
return this . parser . readAscii ( 4 ) . then ( ( reply ) => {
12
12
switch ( reply ) {
13
13
case Protocol . OKAY :
14
- return true ;
14
+ return this . parser . readValue ( ) . then ( ( buffer ) => {
15
+ return Number ( buffer . toString ( ) ) ;
16
+ } ) . catch ( _ => 0 ) ;
15
17
case Protocol . FAIL :
16
18
return this . parser . readError ( ) ;
17
19
default :
You can’t perform that action at this time.
0 commit comments