bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/54039] New: DatagramSocket.receive should throw SocketExc


From: patrick.melo at gmail dot com
Subject: [Bug classpath/54039] New: DatagramSocket.receive should throw SocketException not IOException
Date: Thu, 19 Jul 2012 23:15:44 +0000

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54039

             Bug #: 54039
           Summary: DatagramSocket.receive should throw SocketException
                    not IOException
    Classification: Unclassified
           Product: classpath
           Version: 0.98
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
        AssignedTo: address@hidden
        ReportedBy: address@hidden


On my Mac, running the Oracle JRE, when I close a socket, the receive code
throws a SocketException. With classpath on my embedded device it throws an
IOException. 

I'm including the sample code along with output below.

Also if I omit the call to gc() the process just seems to hang instead of
exiting normally.

==Oracle JRE==
$ java Sample
Listening on port 9999
Closing connection.
java.net.SocketException: Socket closed
    at java.net.PlainDatagramSocketImpl.receive0(Native Method)
    at
java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:145)
    at java.net.DatagramSocket.receive(DatagramSocket.java:725)
    at Sample.run(Sample.java:25)

$ java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
$ 

==classpath==
# jamvm Sample
Listening on port 9999
Closing connection.
java.io.IOException: invalid file descriptor
   at gnu.java.nio.VMChannel$State.getNativeFD(VMChannel.java:680)
   at gnu.java.nio.VMChannel.receive(VMChannel.java:214)
   at
gnu.java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:292)
   at java.net.DatagramSocket.receive(DatagramSocket.java:602)
   at Sample.run(Sample.java:25)

# jamvm -version
java version "1.5.0"
JamVM version 1.5.4
Copyright (C) 2003-2010 Robert Lougher <address@hidden>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2,
or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Build information:

Execution Engine: direct-threaded interpreter with stack-caching
Compiled with: gcc 4.4.6

Boot Library Path: /usr/lib/classpath
Boot Class Path: /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip
#



reply via email to

[Prev in Thread] Current Thread [Next in Thread]