jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java
changeset 7045 525f00c555b2
parent 6301 c90a67d75c9f
child 7668 d4a77089c587
equal deleted inserted replaced
7044:b22b6b6548b5 7045:525f00c555b2
   709                     remoteAddress = sa;
   709                     remoteAddress = sa;
   710                     sender = isa;
   710                     sender = isa;
   711                     cachedSenderInetAddress = isa.getAddress();
   711                     cachedSenderInetAddress = isa.getAddress();
   712                     cachedSenderPort = isa.getPort();
   712                     cachedSenderPort = isa.getPort();
   713 
   713 
   714                     // Socket was not bound before connecting,
   714                     // set or refresh local address
   715                     if (localAddress == null) {
   715                     localAddress = Net.localAddress(fd);
   716                         localAddress = Net.localAddress(fd);
       
   717                     }
       
   718                 }
   716                 }
   719             }
   717             }
   720         }
   718         }
   721         return this;
   719         return this;
   722     }
   720     }
   733                         sm.checkConnect(isa.getAddress().getHostAddress(),
   731                         sm.checkConnect(isa.getAddress().getHostAddress(),
   734                                         isa.getPort());
   732                                         isa.getPort());
   735                     disconnect0(fd);
   733                     disconnect0(fd);
   736                     remoteAddress = null;
   734                     remoteAddress = null;
   737                     state = ST_UNCONNECTED;
   735                     state = ST_UNCONNECTED;
       
   736 
       
   737                     // refresh local address
       
   738                     localAddress = Net.localAddress(fd);
   738                 }
   739                 }
   739             }
   740             }
   740         }
   741         }
   741         return this;
   742         return this;
   742     }
   743     }