mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
dgram: remove unreachable connectState assign
PR-URL: https://github.com/nodejs/node/pull/38590 Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
17
lib/dgram.js
17
lib/dgram.js
@@ -186,9 +186,6 @@ function replaceHandle(self, newHandle) {
|
||||
// Replace the existing handle by the handle we got from primary.
|
||||
oldHandle.close();
|
||||
state.handle = newHandle;
|
||||
// Check if the udp handle was connected and set the state accordingly
|
||||
if (isConnected(self))
|
||||
state.connectState = CONNECT_STATE_CONNECTED;
|
||||
}
|
||||
|
||||
function bufferSize(self, size, buffer) {
|
||||
@@ -292,10 +289,6 @@ Socket.prototype.bind = function(port_, address_ /* , callback */) {
|
||||
if (err)
|
||||
throw errnoException(err, 'open');
|
||||
|
||||
// Check if the udp handle was connected and set the state accordingly
|
||||
if (isConnected(this))
|
||||
state.connectState = CONNECT_STATE_CONNECTED;
|
||||
|
||||
startListening(this);
|
||||
return this;
|
||||
}
|
||||
@@ -553,16 +546,6 @@ function clearQueue() {
|
||||
queueEntry();
|
||||
}
|
||||
|
||||
function isConnected(self) {
|
||||
try {
|
||||
self.remoteAddress();
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// valid combinations
|
||||
// For connectionless sockets
|
||||
// send(buffer, offset, length, port, address, callback)
|
||||
|
||||
Reference in New Issue
Block a user