Skip to content

Commit 9062479

Browse files
pd4d10danielleadams
authored andcommitted
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 9f8e442 commit 9062479

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

‎lib/dgram.js‎

Lines changed: 0 additions & 17 deletions
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
functionbufferSize(self,size,buffer){
@@ -292,10 +289,6 @@ Socket.prototype.bind = function(port_, address_ /* , callback */) {
292289
if(err)
293290
throwerrnoException(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
returnthis;
301294
}
@@ -553,16 +546,6 @@ function clearQueue() {
553546
queueEntry();
554547
}
555548

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

0 commit comments

Comments
 (0)