Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8b3749f

Browse files
pd4d10danielleadams
authored andcommittedMar 2, 2022
dgram: remove unreachable connectState assign
PR-URL: #38590 Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent e4ecbed commit 8b3749f

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed
 

‎lib/dgram.js

-17
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ function replaceHandle(self, newHandle) {
186186
// Replace the existing handle by the handle we got from primary.
187187
oldHandle.close();
188188
state.handle = newHandle;
189-
// Check if the udp handle was connected and set the state accordingly
190-
if (isConnected(self))
191-
state.connectState = CONNECT_STATE_CONNECTED;
192189
}
193190

194191
function bufferSize(self, size, buffer) {
@@ -292,10 +289,6 @@ Socket.prototype.bind = function(port_, address_ /* , callback */) {
292289
if (err)
293290
throw errnoException(err, 'open');
294291

295-
// Check if the udp handle was connected and set the state accordingly
296-
if (isConnected(this))
297-
state.connectState = CONNECT_STATE_CONNECTED;
298-
299292
startListening(this);
300293
return this;
301294
}
@@ -553,16 +546,6 @@ function clearQueue() {
553546
queueEntry();
554547
}
555548

556-
function isConnected(self) {
557-
try {
558-
self.remoteAddress();
559-
return true;
560-
} catch {
561-
return false;
562-
}
563-
}
564-
565-
566549
// valid combinations
567550
// For connectionless sockets
568551
// send(buffer, offset, length, port, address, callback)

0 commit comments

Comments
 (0)
Please sign in to comment.