7099488: TwoStacksPlainSocketImpl should invoke super.create(stream), typo in fix for 7098719

Reviewed-by: coffeys
This commit is contained in:
Chris Hegarty 2011-10-11 12:06:46 +01:00
parent bbcff1b792
commit 08d82ca044
2 changed files with 6 additions and 2 deletions

View File

@ -71,7 +71,7 @@ abstract class AbstractPlainSocketImpl extends SocketImpl
/* whether this Socket is a stream (TCP) socket or not (UDP)
*/
private boolean stream;
protected boolean stream;
/**
* Load net library into runtime.

View File

@ -26,6 +26,7 @@ package java.net;
import java.io.IOException;
import java.io.FileDescriptor;
import sun.net.ResourceManager;
/*
* This class defines the plain SocketImpl that is used for all
@ -82,7 +83,7 @@ class TwoStacksPlainSocketImpl extends AbstractPlainSocketImpl
protected synchronized void create(boolean stream) throws IOException {
fd1 = new FileDescriptor();
try {
super.create();
super.create(stream);
} catch (IOException e) {
fd1 = null;
throw e;
@ -125,6 +126,9 @@ class TwoStacksPlainSocketImpl extends AbstractPlainSocketImpl
protected void close() throws IOException {
synchronized(fdLock) {
if (fd != null || fd1 != null) {
if (!stream) {
ResourceManager.afterUdpClose();
}
if (fdUseCount == 0) {
if (closePending) {
return;