ServerSocket::accept

Bryce McKinlay mckinlay@redhat.com
Sat Jul 10 00:19:00 GMT 2004


Thanks for following this up Michael. I think this patch is important 
enough to go into the 3.4 branch.

Regards

Bryce


Michael Koch wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Am Dienstag, 6. Juli 2004 18:08 schrieb Eric Wong:
>  
>
>>Hi,
>>
>>In version 3.4.0/1, ServerSocket.accept() creates a
>>new Socket() and then in the process invoke
>>Socket.getImpl(), which goes something like this:
>>    
>>
>
>Can you please try the attached patch ? It should fix your problem.
>
>
>Michael
>
>
>2004-07-09  Michael Koch  <konqueror@gmx.de>
>
>	* java/net/ServerSocket.java
>	(accept): Don't create two client sockets when accepting connections.
>- -- 
>Homepage: http://www.worldforge.org/
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.2.4 (GNU/Linux)
>
>iD8DBQFA7w+iWSOgCCdjSDsRAp6GAJ0b1Dk8jcEhZyO7zhRHGg1vOFtrBgCgjKXU
>uyYdsryAbK0wZMcNs9TFcQw=
>=x+gS
>-----END PGP SIGNATURE-----
>  
>
>------------------------------------------------------------------------
>
>Index: java/net/ServerSocket.java
>===================================================================
>RCS file: /cvs/gcc/gcc/libjava/java/net/ServerSocket.java,v
>retrieving revision 1.34.4.1
>diff -u -b -B -r1.34.4.1 ServerSocket.java
>--- java/net/ServerSocket.java	3 Feb 2004 14:50:59 -0000	1.34.4.1
>+++ java/net/ServerSocket.java	9 Jul 2004 21:32:07 -0000
>@@ -354,7 +354,8 @@
>         && !((PlainSocketImpl) getImpl()).isInChannelOperation())
>       throw new IllegalBlockingModeException ();
> 	    
>-    impl.accept(socket.getImpl());
>+    impl.accept(socket.impl);
>+    socket.implCreated = true;
>   }
> 
>   /**
>  
>



More information about the Java mailing list