Skip to content

Commit

Permalink
Remove hard-coded troubleshooting advise for port usage
Browse files Browse the repository at this point in the history
Summary: Currently hard-coded, it doesn't have to be the case.

Reviewed By: mweststrate

Differential Revision: D55743047

fbshipit-source-id: f4c14205b5ace259f495276adf17adcbcce0fd28
  • Loading branch information
lblasa authored and facebook-github-bot committed Apr 5, 2024
1 parent c5f250e commit e336c9e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions desktop/flipper-server-client/src/FlipperServerClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@ export function createFlipperServer(
};

const socket = new ReconnectingWebSocket(URLProvider);
return createFlipperServerWithSocket(socket as WebSocket, onStateChange);
return createFlipperServerWithSocket(
socket as WebSocket,
port,
onStateChange,
);
}

export function createFlipperServerWithSocket(
socket: WebSocket,
port: number,
onStateChange: (state: FlipperServerState) => void,
): Promise<FlipperServer> {
onStateChange(FlipperServerState.CONNECTING);
Expand All @@ -57,7 +62,7 @@ export function createFlipperServerWithSocket(
new Error(
`Failed to connect to the server in a timely manner.
It may be unresponsive. Run the following from the terminal
'sudo kill -9 $(lsof -t -i :52342)' as to kill any existing running instance, if any.`,
'sudo kill -9 $(lsof -t -i :${port})' as to kill any existing running instance, if any.`,
),
);
}, CONNECTION_TIMEOUT);
Expand Down

0 comments on commit e336c9e

Please sign in to comment.