Commit bf172f54 by Michael Koch Committed by Michael Koch

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
parent 9481d818
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.
2003-09-25 Ingo Proetel <proetel@aicas.com> 2003-09-25 Ingo Proetel <proetel@aicas.com>
* java/io/ObjectOutputStream.java: * java/io/ObjectOutputStream.java:
......
...@@ -112,6 +112,21 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl ...@@ -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 * Binds this socket to a particular port and interface
* *
...@@ -267,14 +282,4 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl ...@@ -267,14 +282,4 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
{ {
mcastGrp(((InetSocketAddress)mcastaddr).getAddress(), netIf, false); 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 ...@@ -142,6 +142,11 @@ public final class PlainSocketImpl extends SocketImpl
super.finalize(); super.finalize();
} }
public int getNativeFD()
{
return fnum;
}
/** /**
* Sets the specified option on a socket to the passed in object. For * 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 * options that take an integer argument, the passed in object is an
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment