Skip to content

Commit

Permalink
extend timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottyPoi committed Aug 5, 2023
1 parent d81ab41 commit 8536a56
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/portalnetwork/src/wire/utp/Socket/UtpSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ export class UtpSocket extends EventEmitter {
// TODO: Else wait for all data packets.
return new Promise((res, _rej) => {
const panic = setTimeout(() => {
res(Uint8Array.from([]))
}, 5000)
res(Uint8Array.from([0, 0, 0, 0, 0, 0, 0, 0]))
}, 10000)
this.once('done', async () => {
this.seqNr = this.seqNr + 1
this.ackNr = packet.header.seqNr
Expand All @@ -305,7 +305,9 @@ export class UtpSocket extends EventEmitter {
let _content = await this.reader!.run()
this.logger(`Packet payloads compiled into ${_content.length} bytes. Sending FIN-ACK`)
if (_content.length === 0) {
_content = await this.reader!.run()
while (_content.length === 0) {
_content = await this.reader!.run()
}
}
this.close()
this._clearTimeout()
Expand Down

0 comments on commit 8536a56

Please sign in to comment.