Socket not timing out - if network is disabled

Hi All,
I am using java.net.Socket to connect to a TCP/IP server. And using timeout in case of non-activity between the server-client.
This is the code I use to transfer data...
out = new BufferedWriter(new OutputStreamWriter (
                                        sckt.getOutputStream()));
in = new BufferedReader(new InputStreamReader(
                                        sck.getInputStream()));
out.write(msg); //char[]
out.flush();
while (! in.ready());Now the server is slow in responding so I have to wait on in.ready() but meanwhile if I disable the network manually... the reader will keep waiting and Socket timeout doesnot take place atall... let me know whats wrong with this idea ....
thanks a lot,
Ri

If you mean pull the wire out of the back of a PC
running Win2k (and quite possibly other Windows and
quite possible other OS) then various things seem to
go wrong at random, including but not limited to some
but not all threads hanging, the application
terminating without any message, and so on.It most assuredly does not do that on solaris.
And I strongly suspect that if the application is code correctly (as the ones that I tested using that on solaris) then it won't happen on windows either. I can't imagine anyway in which a thread will hang when a network cable is pulled, unless of course the thread is blocking indefinitely on a socket. But that happens on any system, since that is the defined behavior of a socket.

Similar Messages

  • JDBC pooling Oracle driver Socket read timed out

    I run Java EE application on Glassfish server v3 together with Oracle 12 DB on the same machine under Windows Server 2012 64bit. I use latest ojdbc7 driver.
    Connection pool config:
      <jdbc-connection-pool validation-table-name="DUAL" steady-pool-size="20" statement-cache-size="100" associate-with-thread="true" statement-timeout-in-seconds="30" idle-timeout-in-seconds="60" max-wait-time-in-millis="2000" validate-atmost-once-period-in-seconds="20" datasource-classname="oracle.jdbc.pool.OracleDataSource" pool-resize-quantity="5" max-pool-size="60" res-type="javax.sql.DataSource" name="dbPool" is-connection-validation-required="true">
      <property name="driverClass" value="oracle.jdbc.OracleDriver"></property>
      <property name="user" value="xxx"></property>
      <property name="url" value="jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=orcl)))"></property>
      <property name="password" value="xxx"></property>
      <property name="portNumber" value="1521"></property>
      <property name="databaseName" value="orcl"></property>
      <property name="serverName" value="127.0.0.1"></property>
      <property name="oracle.jdbc.ReadTimeout" value="300000"></property>
      <property name="oracle.net.CONNECT_TIMEOUT" value="10000"></property>
      </jdbc-connection-pool>
    After 2 or 3 hours, when there is more than 1 user (3-5) using my application, it stops responding and I get this in glassfish logs
      javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.allocator|_ThreadID=152;_ThreadName=Thread-2;|RAR5038:Unexpected exception while creating resource for pool dbPool. Exception : javax.resource.spi.ResourceAllocationException: Connection could not be allocated because: IO Error: Socket read timed out
      Local Exception Stack:
      Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
      Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: IO Error: Socket read timed out
    From the database side it looks like this
    Fatal NI connect error 12560, connecting to:
      (LOCAL=NO)
      VERSION INFORMATION:
      TNS for 64-bit Windows: Version 12.1.0.1.0 - Production
      Oracle Bequeath NT Protocol Adapter for 64-bit Windows: Version 12.1.0.1.0 - Production
      Windows NT TCP/IP NT Protocol Adapter for 64-bit Windows: Version 12.1.0.1.0 - Production
      Time: 13-JUN-2014 03:14:49
      Tracing not turned on.
      Tns error struct:
      ns main err code: 12560
      TNS-12560: TNS:protocol adapter error
      ns secondary err code: 0
      nt main err code: 0
      nt secondary err code: 0
      nt OS err code: 0
      opiodr aborting process unknown ospid (3404) as a result of ORA-609
    When I just reset db listener everything works ok for next 1-2 hours (depends on application load). So temporary solution is to run bat script from windows scheduler to reset the listener every 1h.
    I tried everything I could find - applied these parameters:
      - Sqlnet.ora:
      SQLNET.INBOUND_CONNECT_TIMEOUT=180
      SQLNET.EXPIRE_TIME=5
      - Listener.ora:
      INBOUND_CONNECT_TIMEOUT_LISTENER_IPC=120
    But still without success

    Is the problem here just that you need a connection pool that closes idle connections?  Some pools will close idle connections after a time out period.  And the pool lets you set that time out period.  If the pool you are using doesn't provide that then use a different pool.

  • Operation timed out (FSP network services manager)

    Received this error from five different RMAN jobs, all submitted at approx 6am, all failing within a couple of minutes. Resubmit of all five jobs worked fine. Many other jobs submitted at approx the same time worked fine. Time out does not appear to be related to waiting on tape drive resources.
    Any ideas as to cause? If this is a network thing, any way to extend the timeout or cause it to retry?
    Regards,
    Rich McClain
    ORA-19506: failed to create sequential file, name="SBT_TAPE/RMAN_SCMP.707724115.arch.1.7372.1", parms=""
    ORA-27028: skgfqcre: sbtbackup returned error
    ORA-19511: Error received from media manager layer, error text:
    sbt__rpc_cat_query: Query for piece SBT_TAPE/RMAN_SCMP.707724115.arch.1.7372.1 failed.
    (Oracle Secure Backup error: 'operation timed out (FSP network services manager)').
    Snippet from obroxyd.log
    2010/01/08.06:02:57 [2543] failed to connect to admin scheduler - operation timed out (FSP network services manager)
    2010/01/08.06:03:02 [2543] client disconnect from IPC connection 4 (closing)
    2010/01/08.06:03:03 [2543] obproxyd is terminating now
    2010/01/08.06:03:11 [9770] failed to connect to admin scheduler - operation timed out (FSP network services manager)
    2010/01/08.06:03:16 [9770] client disconnect from IPC connection 4 (closing)
    2010/01/08.06:03:16 [9770] obproxyd is terminating now

    Either reconfigure CONNECT_TIMEOUT to be 0, which means wait indefinitely, or reconfigure CONNECT_TIMEOUT to be some higher value. Or, if the timeout is unacceptably long, turn on tracing for further information.
    If you have oracle metalink, then read the following note;
    Note:119706.1 - Troubleshooting Guide TNS-12535 & ORA-12535 Errors

  • WebLogic 11g data source connection pooling failed with IO error:socket read timed out.

    Hi all,
    We encountered IO Error: Socket read timed out( <Received exception while creating connection for pool "DS_1": IO Error: Socket read timed out> ) during the creation of data sources in WebLogic 11g. Manual data source testing seems to indicate intermittent connection and the server seems to take a long time to start up with multiple IO errors. We increased the timeout at the database side but it does not seems to help. The database is 11g (11.2.0.3). The database services and listener are up which does not indicate that the database instance is down.

    This particular error means your database is down and socket is timedout. Or the query takes so long that the reader timedout -- unlikely.
    Also, the general weblogic socket write errors, which you might see sometimes means that the client got disconnected before the server wrote results back. This is harmless

  • Java.sql.SQLException: Io exception: Socket read timed out

    Hello,
    I've a interface RFC - JDBC - RFC.
    When this interface is executing, i have the follow error in RuntimeWorkbench::
    'Unable to execute statement for table or stored procedure. 'TABLAERR' (Structure 'STATEMENT') due to java.sql.SQLException: Io exception: Socket read timed out'
    In SXMB_MONI do not see any message, only
    '  <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry> '
    this error don't occurs always, when and why i don't know..
    I searched for information about this error and nothing found
    why it is happens?
    thank very much

    HI,
    This is not a problem in ur mapping or configuration.
    This is a problem with JDBC connection. This is a common error, that generally comes when the DB server is receiving and processing numerous records. Connection time out or socket read time out.
    First try this:
    In ur JDBC adapter go to Advanced Tab Page and check Transaction Isolation Level as Serializable.
    If still problem persists then take help of basis guys and increase the timeout for the connection, same thing can be asked from DB team.

  • IO Error: Socket read timed out / IOP_iopinstance1_datasource" closed

    Hi ,
    Can somebody suggest what could be the probable cause of following errors showing up in IOP log file?
    ####<Aug 16, 2011 10:49:11 PM PDT> <Info> <Common> <sc-csttest> <IOPServer_iopinstance1> <weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@357ac2f7> <<anonymous>> <> <0000J7MI9kZFk3vLsYw0yX1EIpFA00002K> <1313560151943> <BEA-000628> <Created "1" resources for pool "IOP_iopinstance1_datasource", out of which "1" are available and "0" are unavailable.>
    ####<Aug 16, 2011 10:49:12 PM PDT> <Info> <JDBC> <sc-csttest> <IOPServer_iopinstance1> <weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@357ac2f7> <<anonymous>> <> <0000J7MI9kZFk3vLsYw0yX1EIpFA00002K> <1313560152146> <BEA-001128> <Connection for pool "IOP_iopinstance1_datasource" closed.>
    java.sql.SQLRecoverableException: IO Error: Socket read timed out
    Thanks
    Lokesh

    This particular error means your database is down and socket is timedout. Or the query takes so long that the reader timedout -- unlikely.
    Also, the general weblogic socket write errors, which you might see sometimes means that the client got disconnected before the server wrote results back. This is harmless

  • Request threads not timing-out

    I am connecting to the crystal report server(11.5) using RAS APIs from my web application hosted on Websphere 6.
    It seems the threads are not timing out, below are the threads:
    com.crystaldecisions.thirdparty.com.ooc.OB.GIOPClientWorkerThreaded$SenderThread                                                               
    com.crystaldecisions.thirdparty.com.ooc.OB.GIOPClientWorkerThreaded$ReceiverThread      
    com.crystaldecisions.thirdparty.com.ooc.OB.GIOPServerStarterThreaded$StarterThread                                                             
    com.crystaldecisions.thirdparty.com.ooc.OB.GIOPClientWorkerThreaded$SenderThread                                                               
    com.crystaldecisions.thirdparty.com.ooc.OB.GIOPClientWorkerThreaded$ReceiverThread     
    I tried putting clientSDKOptions.xml in my web application but it doesn't seem to be working.
    Any inputs to this will be helpful.

    I'd give more details concerning the clientSDKOptions.xml.
    Sincerely,
    Ted Ueda

  • OSB Business Service is not timing out on Connection/Read timeout

    I have a weird problem with my business service in OSB. I have set the read timeout value as 1 sec and Connection timeout value as 1 sec. The response from backend is taking more than 2 seconds or even 3 seconds but still my business service is not timing out..! My service is still listening to the response from backend even if it comes after 3 seconds. I expect it to timeout after 2 seconds. Any ideas?
    Business Service Configurations:
    Service Type: Any type
    Protocol: http
    Retry count : 0
    Retry Application Errors: No
    Read Timeout: 0
    Connection Timeout: 0
    HTTP Request Method: POST
    Result Caching: No
    Let me know if you need any more information. Thanks in Advance.
    Regards
    Kaleem

    AbhishekJ wrote:
    Maximum possible successful response time of the service will be less than Read TO + Connection TO.
    Alas, this is not true.
    Maximum possible response time is infinity.
    There are two reasons for that.
    1. Read timeout is not counted as time from the successful connection establishing to the current moment. It is measured as time from the last received byte to now. Imagine a backend service that sends a single byte in a data packet every 500ms. Despite you have read timeout set to 1, the receiving of 3K message will take 25 minutes, and yet your Biz service will not timeout.
    2. In HTTPS, handshake is handled by a separate library which has its own quirks. Specifically, if the key exchange is broken at particular point of handshake, the library re-establishes the connection and does it few times; in my experiements, the largest I could delay the eventual fault was about 3 minutes.
    Having said that, in the OP message the configuration is Read=0, Connect=0, so I wonder why the timeout is expected.

  • Session not timing out...

    Hi all, for some reason, my session is not timing out. If I
    leave my browser and come back the next day, I can still continue
    working. Can someone tell me why?
    My code
    <cfapplication name="myApp" sessionmanagement="yes"
    sessiontimeout="#CreateTimeSpan(0,0,30,0)#">
    Thank you so much,
    C

    Hi Ian, how can I make it so that after 30 minutes if a user
    tries to
    hit any page in my site, they would go back to login page to
    relogin?
    Thanks so much,
    C
    Check that the session data still exists. This will very
    depending on
    how exactly you are handling your login state. But since you
    mention
    session, I will presume you are rolling your own rather then
    using the
    <cflogin...> some other functionality.
    I would do something like this in my code.
    <cfif NOT StructKeyExists(session, "LoginName")>
    <cflocation url="LoginForm.cfm">
    </cfif>
    Obviously you would set session.LoginName to some value on a
    successful
    login. Also note that if this check occurs before the
    LoginForm.cfm
    page you will create an endless loop. There are much more
    sophisticated
    solutions, but this gives you a bare bones option.

  • Lighthouse Approvals not timing out

    I'm running into a problem where my lighthouse approvals are not timing out. I've declared the timeout value and I'm only transitioning onto the success path if the return from the approvals.approved variable is set to true. My problem is that the approval never times out, nor does it escalate if an escalator is declared.
    Has anyone run into this before? Is there something in the Lighthouse Approvals that I need to change for this to work? Any help would be greatly appreciated
    <Activity id='8' name='Director Approval'>
    <Action id='0' process='Lighthouse Approvals'>
    <Variable name='allApprovals' value='false'/>
    <Variable name='approvalTemplate' value='UserForm-DirApproval'/>
    <Variable name='approvalForm' value='UserForm-RoleApproval'/>
    <Variable name='user' value='$(userView)'/>
    <Variable name='authorized' value='true'/>
    <Variable name='subject' value='Configurator'/>
    <Variable name='approvals'>
    <rule name='RuleLibrary:Get Approval Role'/>
    </Variable>
    <Variable name='additionalApproversList'>
    <list>
    <ref>director</ref>
    </list>
    </Variable>
    <Variable name='timeout' value='3'/>
    <Return from='approvals.approved' to='DirApproval'/>
    </Action>
    </Activity>

    I found that if I make the timeout variable external rather than input in the Multi Approval subprocess that it works. It looks like the Lighthouse Approval calls the multi approval subprocess, but wasn't passing the timeout value to it correctly.

  • Java.sql.SQLException: Socket read timed out

    // DbTest.java
    <code>
    import java.sql.*;
    import java.io.*;
    public class DbTest
    public static void main(String args[])
    System.out.println("DbTest main(-)");
    Connection con = null;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    System.out.println("class loaded");
    con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcldb","scott","tiger");
    System.out.println("con obj created");
    System.out.println("con obj retrived");
    if (con!=null)
    System.out.println("Connection created successfully");
    else
    System.out.println("Connection refused");
    catch (SQLException e)
    e.printStackTrace();
    catch(Exception e)
    e.printStackTrace();
    </code>
    e:\JavaPrgms\JDBC>javac DbTest.java
    e:\JavaPrgms\JDBC>java DbTest
    DbTest main(-)
    class loaded
    java.sql.SQLException: Socket read timed out
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
    531)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensio
    n.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at DbTest.main(DbTest.java:17)
    Caused by: oracle.net.ns.NetException: Socket read timed out
    at oracle.net.ns.Packet.receive(Packet.java:320)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:286)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
    ... 7 more
    i am using win 7 64bit os , Oracle 11.2, Jdk 1.7 how can i resolve this problem?
    Edited by: 910776 on Oct 4, 2012 10:49 AM

    Your other thread got locked because all you did was post a bunch of code without explaining what your question or issue was or what the code is supposed to be doing.
    java.sql.SQLException: Socket read timed out
    Simply reposting in this forum isn't enough. Edit your post and and add \ tags on the line before and the line after the code to preserve the formatting.
    Also explain what you are trying to do, the problem you are having and answer the questions I ask you in your other thread.
    {quote}
    What is it you are trying to do?
    Why are you trying to connect to two different databases?
    Do either of those databases actually exist?
    Do they exist on the local machine that Java is running on?
    Can you connect to either of them without using Java?
    {quote}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • I keep trying to download ios5 but it keeps saying my network timed out but network is fine any ideas

    having trouble downloading ios5 keep getting error saying network timed out but network is fine

    Hello Nitadoo,
    u can make a new id and password by going to apple.com and clicking on the forgot id and forgot password button in login.
    also u can go to a nearby apple store and tell them that u want a new apple id and password
    maybe they'll even help u to retrieve ur old apple id and password
    HOPE THIS'LL BE HELPFUL

  • I have Itunes 10- i am usinf windows 7- i am trying to upgrade my itouch 64gb 4.2.1 to ios5 - but keep getting an error meassage at he end saying check network connection- timing out- yet network is on??? Help!

    i have itouch 64gb, i have itunes 10 loaded -trying to upgrade to Ios5 - at the end of the long dowload is says- chack network connection-=  network times out- yet network is on as is Ipod- whats up?

    I'm not certain thats the problem. I stopped antivirus, I set screensaver to NOT trigger and yet it took me FOUR DAYS to completely sync my ipod touch. Stupid me decided to try it with the iPad and guess what...it's been three days and STILL timing out.
    I don't think Steve Jobs died; I think they upgraded him to iOS5, he crashed and they could not restore him.
    THIS UPGRADE *****. They rushed it out the door to get the fancy-dancy voice command thing on the iphones and yet that feature does not help ipod or ipad users.

  • JRUN Apache connector not timing out despite setting recvTimeout

    Hi,
           I have set a recvTimeout for the JRUN apache connector using the
        [Thu Dec 15 15:29:48 2011] [notice] jrApache[3068: 20480]     ap_escape_uri(TimeoutTest.cfm) = TimeoutTest.cfm
    [Thu Dec 15 15:29:48 2011] [notice] jrApache[3068: 20480]  jrun_trans: sub-request so DECLINED
    [Thu Dec 15 15:29:48 2011] [notice] jrApache[3068: 20480]     getRealPath(TimeoutTest.cfm) = TimeoutTest.cfm
    [Thu Dec 15 15:29:48 2011] [notice] jrApache[3068: 20480]  sent/avail/result 79/79/79
    [Thu Dec 15 15:29:53 2011] [notice] jrApache[3068: 20480]  read/len/total 4/4/4
    [Thu Dec 15 15:29:53 2011] [notice] jrApache[3068: 20480]  PROXY_GET_HEADER <- [11]
    [Thu Dec 15 15:29:53 2011] [notice] jrApache[3068: 20480]  read/len/total 4/4/4
    [Thu Dec 15 15:29:53 2011] [notice] jrApache[3068: 20480]  read/len/total 21/21/21
    [Thu Dec 15 15:29:53 2011] [notice] jrApache[3068: 20480]     HTTP_X_REQUESTED_WITH: <null>
    [Thu Dec 15 15:29:53 2011] [notice] jrApache[3068: 20480]  sent/avail/result 4/4/4
    [Thu Dec 15 15:34:53 2011] [notice] jrApache[3068: 20480]  67.206.10.197:51050 jrConnect [9]
    [Thu Dec 15 15:34:53 2011] [notice] jrApache[3068: 20480]  sent/avail/result 4/4/4
    [Thu Dec 15 15:34:53 2011] [notice] jrApache[3068: 20480]  67.206.10.197:51050 is reachable
    [Thu Dec 15 15:34:53 2011] [notice] jrApache[3068: 20480]  sent/avail/result 4/4/4
    [Thu Dec 15 15:34:53 2011] [notice] jrApache[3068: 20480]  67.206.10.197:51050 is reachable
    [Thu Dec 15 15:34:53 2011] [notice] jrApache[3068: 20480]  67.206.10.197:51050 returned socket [9] to pool
    [Thu Dec 15 15:34:53 2011] [notice] jrApache[3068: 20480]  jrRecv [11] timeout but server reachable so recv again
    [Thu Dec 15 15:36:33 2011] [notice] jrApache[3068: 20480]  read/len/total 4/4/4
    [Thu Dec 15 15:36:33 2011] [notice] jrApache[3068: 20480]  PROXY_GET_REALPATH <- [11]
    [Thu Dec 15 15:36:33 2011] [notice] jrApache[3068: 20480]  read/len/total 4/4/4
    What does this error mean: jrRecv [11] timeout but server reachable so recv again
    Is the jrun apache connector retrying or waiting some more for the page response ? I dont want it to retry / wait beyond the recvTimeout that I have set. What can I do in the config or elsewhere so that the recvTimeout returns as a timeout to apache and cleint without recv again attempt that it appears to be doing?
    Thanks in advance for any help on this.
    JRunConfig RecvTimeout 300
            I want this setting so long running pages will time out and return after 300 s with a timeout error and return the error back to the client.
    However, I see that the timeout is not working and long running cfm pages continue to cycle without returning. Upon enabling the verbose option I see the following error logged for the long running page after the timeout occurs, but the page does not return anything and continues to wait on the client side.

    sunilr1 wrote:
    Hi,
           I have set a recvTimeout for the JRUN apache connector using the
    JRunConfig RecvTimeout 300
            I want this setting so long running pages will time out and return after 300 s with a timeout error and return the error back to the client.
    That is not the setting to time out long-running pages and then return a message. Why would you want to control request timeouts from JRun anyway? I don't think it's a good idea.
    RecvTimeout determines how long to wait before timing out a socket receive call on a JRun server. The receive call is generally a synchronous call on a socket on a JRun server. It will throw an exception if the time out period is exceeded. In other words,  a long-running page does not necessarily imply a long wait on a socket receive call.

  • Why do I ge a timed out for network ATT648

    Why do I get a timed out connection for network ATT648 I can use jarius, but prefer ATT648

    Hi Jon
    just a shortcut or alias to an item that no longer exists.
    Ctrl-click & use 'icon & text' & you will see a name for it, which may give a clue as to the origin. Just ctrl-click it choose 'remove item' to get rid. Or use Finder-View-Customise Toolbar to drag it off into a puff of smoke.

Maybe you are looking for