HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Java Thread Problem on HP-UX 11.00
Operating System - HP-UX
1825795
Members
2281
Online
109687
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 08:12 PM
05-21-2002 08:12 PM
Java Thread Problem on HP-UX 11.00
Hi,
I have a problem on my HP-UX 11.00 system, while running a simple java program where the serverSocket.accept() method is waiting to accept connections and in a different thread serversocket.close() is issued. On receiving serversocket.close() the behavior is to throw an exception called "SocketException" and come out of serversocket.accept() waiting method.
Below is the behavior (output) in win2k machine. This output occurs in win2k, winNT, Solaris
C:\jdk1.3\bin>java ThreadTest
ThreadTest-main: Entering main method
ThreadTest-main: Created ServerSocket object
CloseServerSocket: Created CloseServerSocket object
ThreadTest-main: Starting the thread which will close the server socket
ThreadTest-main: Waiting to accept connections
CloseServerSocket-run: Entering run method
CloseServerSocket-run: Trying to close serversocket using close method
Exception :java.net.SocketException: socket closed
ThreadTest-main: Exiting main method
CloseServerSocket-run: Successfully closed serversocket using close method
CloseServerSocket-run: Exiting run method
C:\jdk1.3\bin>
The behavior(output) in HP-UX machine
bash-2.04$ ./java ThreadTest
ThreadTest-main: Entering main method
ThreadTest-main: Created ServerSocket object
CloseServerSocket: Created CloseServerSocket object
ThreadTest-main: Starting the thread which will close the server socket
ThreadTest-main: Waiting to accept connections
CloseServerSocket-run: Entering run method
CloseServerSocket-run: Trying to close serversocket using close method
You could see that it never returned to the bash shell prompt, it actually hangs. It never throws the exception and doesn't comes out of the waiting serverSockte.accept() method. This is not the actual behavior. Java handles all socket type functions through native implementations. All we wanted to know is whether any body has encountered such a problem in HP-UX and whether they have any solutions for it.
Please recommend if any patch could solve thish problem.
The same problem is attached in the doc. along with the swlist output of the system.
Thanks and Regards,
Shyam.
I have a problem on my HP-UX 11.00 system, while running a simple java program where the serverSocket.accept() method is waiting to accept connections and in a different thread serversocket.close() is issued. On receiving serversocket.close() the behavior is to throw an exception called "SocketException" and come out of serversocket.accept() waiting method.
Below is the behavior (output) in win2k machine. This output occurs in win2k, winNT, Solaris
C:\jdk1.3\bin>java ThreadTest
ThreadTest-main: Entering main method
ThreadTest-main: Created ServerSocket object
CloseServerSocket: Created CloseServerSocket object
ThreadTest-main: Starting the thread which will close the server socket
ThreadTest-main: Waiting to accept connections
CloseServerSocket-run: Entering run method
CloseServerSocket-run: Trying to close serversocket using close method
Exception :java.net.SocketException: socket closed
ThreadTest-main: Exiting main method
CloseServerSocket-run: Successfully closed serversocket using close method
CloseServerSocket-run: Exiting run method
C:\jdk1.3\bin>
The behavior(output) in HP-UX machine
bash-2.04$ ./java ThreadTest
ThreadTest-main: Entering main method
ThreadTest-main: Created ServerSocket object
CloseServerSocket: Created CloseServerSocket object
ThreadTest-main: Starting the thread which will close the server socket
ThreadTest-main: Waiting to accept connections
CloseServerSocket-run: Entering run method
CloseServerSocket-run: Trying to close serversocket using close method
You could see that it never returned to the bash shell prompt, it actually hangs. It never throws the exception and doesn't comes out of the waiting serverSockte.accept() method. This is not the actual behavior. Java handles all socket type functions through native implementations. All we wanted to know is whether any body has encountered such a problem in HP-UX and whether they have any solutions for it.
Please recommend if any patch could solve thish problem.
The same problem is attached in the doc. along with the swlist output of the system.
Thanks and Regards,
Shyam.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2002 10:58 AM
05-23-2002 10:58 AM
Re: Java Thread Problem on HP-UX 11.00
Here is the answer from
http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,1353,00.html
at the "developer & solution partner portal", http://www.hp.com/dspp -
------------------------------------------
closing a socket when accept or read is pending
If a thread is performing an accept or read on a socket, and you try to close the socket to clean up resources, the default behavior is for the close() to block until the accept or read call completes. If you want to change this behavior, you should use the following Java command line option:
-XdoCloseWithReadPending
This option allows one thread to close a socket when there is an outstanding accept or read pending on the same socket from another thread.
With the -XdoCloseWithReadPending option, the socket close() call closes the socket and, in the context of the thread with the pending read or accept, a SocketException with the message "Socket closed" is thrown.
Thanks to Judy Muchowski.
http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,1353,00.html
at the "developer & solution partner portal", http://www.hp.com/dspp -
------------------------------------------
closing a socket when accept or read is pending
If a thread is performing an accept or read on a socket, and you try to close the socket to clean up resources, the default behavior is for the close() to block until the accept or read call completes. If you want to change this behavior, you should use the following Java command line option:
-XdoCloseWithReadPending
This option allows one thread to close a socket when there is an outstanding accept or read pending on the same socket from another thread.
With the -XdoCloseWithReadPending option, the socket close() call closes the socket and, in the context of the thread with the pending read or accept, a SocketException with the message "Socket closed" is thrown.
Thanks to Judy Muchowski.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP