2003-09-25 Michael Koch <konqueror@gmx.de>
* gnu/java/net/PlainDatagramSocketImpl.java (finalize): Moved to directly after constructor. (getNativeFD): New method. * gnu/java/net/PlainSocketImpl.java (getNativeFD): New method. From-SVN: r71792
This commit is contained in:
parent
9481d818d9
commit
bf172f5467
3 changed files with 28 additions and 10 deletions
|
@ -112,6 +112,21 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
|
|||
{
|
||||
}
|
||||
|
||||
protected void finalize() throws Throwable
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
if (fnum != -1)
|
||||
close();
|
||||
}
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
public int getNativeFD()
|
||||
{
|
||||
return fnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Binds this socket to a particular port and interface
|
||||
*
|
||||
|
@ -267,14 +282,4 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
|
|||
{
|
||||
mcastGrp(((InetSocketAddress)mcastaddr).getAddress(), netIf, false);
|
||||
}
|
||||
|
||||
protected void finalize() throws Throwable
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
if (fnum != -1)
|
||||
close();
|
||||
}
|
||||
super.finalize();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,6 +142,11 @@ public final class PlainSocketImpl extends SocketImpl
|
|||
super.finalize();
|
||||
}
|
||||
|
||||
public int getNativeFD()
|
||||
{
|
||||
return fnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the specified option on a socket to the passed in object. For
|
||||
* options that take an integer argument, the passed in object is an
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue