Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

Commit 27b5641

Browse files
authored
fix: [Issues: #4] httpBridge.stop()方法调用导致服务器无法重新连接问题处理 (#6)
1 parent 9112390 commit 27b5641

3 files changed

Lines changed: 1 addition & 6 deletions

File tree

harmony/http_bridge.har

-12 Bytes
Binary file not shown.

harmony/http_bridge/src/main/ets/RNHttpBridgeTurboModule.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export class RNHttpBridgeTurboModule extends TurboModule implements TM.ReactNati
7474

7575
private stopServer() {
7676
if (this.server != null) {
77-
this.server.stop();
7877
this.server = null;
7978
this.port = 0;
8079
}

harmony/http_bridge/src/main/ets/Server.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class Server {
7474
this.context.rnInstance.emitDeviceEvent(SERVER_EVENT_ID, result);
7575

7676
emitter.once('requestId' + this.requestId, (data) => {
77-
Logger.info(TAG, 'on EventEmitter data: ' + JSON.stringify(data.data))
77+
Logger.info(TAG, 'on EventEmitter data: ' + JSON.stringify(data.data));
7878
if (this.requestId === data.data.requestId) {
7979
res.writeHead(data.data.code, {
8080
'Content-Type': data.data.type,
@@ -96,8 +96,4 @@ export class Server {
9696
};
9797
emitter.emit('requestId' + requestId, eventData);
9898
}
99-
100-
stop() {
101-
this.polkaServer.server?.stop();
102-
}
10399
}

0 commit comments

Comments
 (0)