Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed connection no close #1308

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ browserstack.err
.tscache
test/public
.vscode/
.npmrc
3 changes: 3 additions & 0 deletions .npmrc.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Create Github Personal Access Token (classic) with write:packages scope
# at https://github.com/settings/tokens to be able to publish packages to Github npm registry locally.
//npm.pkg.github.com/:_authToken=XXXXXXX
14 changes: 9 additions & 5 deletions lib/negotiator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export class Negotiator<

const config: RTCDataChannelInit = { ordered: !!options.reliable };

if (!config.ordered) {
config.maxRetransmits = 0;
}

const dataChannel = peerConnection.createDataChannel(
dataConnection.label,
config,
Expand Down Expand Up @@ -93,11 +97,11 @@ export class Negotiator<
logger.log(
"iceConnectionState is failed, closing connections to " + peerId,
);
this.connection.emitError(
BaseConnectionErrorType.NegotiationFailed,
"Negotiation of connection to " + peerId + " failed.",
);
this.connection.close();
// this.connection.emitError(
// BaseConnectionErrorType.NegotiationFailed,
// "Negotiation of connection to " + peerId + " failed.",
// );
// this.connection.close();
break;
case "closed":
logger.log(
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "peerjs",
"version": "1.5.4",
"name": "@deadsetbit/peerjs",
"version": "1.5.4-fork.0",
"keywords": [
"peerjs",
"webrtc",
Expand All @@ -14,7 +14,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/peers/peerjs"
"url": "https://github.com/deadsetbit/peerjs"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"license": "MIT",
"contributors": [
Expand Down