Socket read delay question

I'm having a delay problem only on Solaris 10 using the Tomcat connector from IIS to Solaris.
I've posted this issue on a couple of Java forums with no luck. Hopefully, this forum will have the correct audience.
I have:
- IIS 6, Windows 2003 Server on dual PIII with jk 1.2.15 installed and working.
- Solaris 10 on Sun E420R with Quad Processors with jBoss / Tomcat version 4.0.3SP1 installed and working.
There is a significant delay in page loading that occurs randomly (every 10-20 clicks) which lasts for 10-18 or so seconds.
I've traced it to a read() method in the ChannelSocket.java file on the AJP (i.e. Tomcat / Solaris 10) side.
The delay always occurs while the receive() method is reading the header portion of the message.
The length of the header that the read is trying to read is 4 bytes. The call to BufferedInputStream()
will block until it gets these 4 bytes of the header (10-18 seconds). I've modified the Java code
and put a call in to available() before and after the read. The before returns 0 and the after returns 1138 or so.
I've tried every imaginable combination of configs on the IIS side to get around the problem ... and then
some kernel TCP/IP configs on the Solaris side ... too many to list here.
The problem seems to be isolated to Solaris ... because Linux, XP, Windows 2003 server all work without this problem.
My question is this ... is there any thing that I can configure to have this read return faster?
Changes to the Solaris kernel ... some config parameter ... ?? Anyone experience this before?
I'll gladly list the things I've tried to get some idea of how to solve this.
I think ultimately this is my problem: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4479751
Thanks in advance!

Hi!
Try this...
Socket connection = new Socket(server,port);
// use a Buffered*Stream as often as possible, because
// of the IP Packet Lengths...It Increases the
// network performance (but you DON'T need it)
// you'll send bytes or messages to the server in
// the OutputStream and receive answers from the
// server in the InputStream
int packetOutputBufferSize = connection.getSendBufferSize();
int packetInputBufferSize = connection.getReceiveBufferSize();
BufferedOutputStream bos = new BufferedOutputStream(connection.getOutputStream(),packetOutputBufferSize);
BufferedInputStream bis = new BufferedInputStream(connection.getInputStream(),packetInputBufferSize);
// sending data through the socket
// create your packet in a byte array
byte[] output = new byte[<packet-lenght>];
output[0]=<packet ID>
output[1]=....
bos.write(output,0,output.length);
// receiving data from the socket
byte[] input = new byte[<max-packet-length>];
int read=0;
int length=0;
while ((read=bis.read(input,length,(input.length-length)) > 0) {
length+=read;
if (length>=input.length) break;
// now your server output is in the bytearray 'input'
If it isn't possible to set a max packet size, use a bytearray as buffer and write it content into a ByteArrayOutputStream, thats something like a resizable write-only byte array. (you'll get the full content of it by calling the method ByteArrayOutputStream.toByteArray())
Maybe you want to check the packet content during receiving the bytes from the socket: Then you should use some read() method from the InputStream, but thats not very powerful.

Similar Messages

  • Newbie socket read write question

    Hello all,
    I need to develop a simple client application in java using socket
    programming. The client will connect to a server implemented in VC++.
    The server part has been implemented so I need to develop only the
    client part.
    Could anybody help me with a simple program that sends data to the
    server and then prints out whatever the server sends back for the
    given request.
    The client and the server communicate using a specified format of bytes as shown below. I do not know how to read those bytes using the sizes as the token.
    I know how to connect to the server but I do not know the proper way of sending and receiving data.
    connection = new Socket(destination, port);
    outStream = new DataOutputStream connection.getOutputStream());
    //send the ID 1 to the server
    outStream.writeByte(1);
    //send the total packet size
    //send the data
    Thanks in advance
    Pertheli
    The client and server communicates with the following packet format
    shown below. Each packet will have header, size and data as shown
    PACKET
    offset(byte) contents
    0 byte PACKET ID
    1 byte PACKET length (motolora format)
    2 byte
    3 byte DATA * n (motolora format)
    4 byte
    5 byte ~ DATA
    n byte
    Now for a For say PACKET ID = 1
    we send the data to the server like
    0 byte (motolora format)
    3 byte
    Then from the VC server we recieve the data in the format such as
    0 byte Name
    43 byte
    44 byte Status

    Hi!
    Try this...
    Socket connection = new Socket(server,port);
    // use a Buffered*Stream as often as possible, because
    // of the IP Packet Lengths...It Increases the
    // network performance (but you DON'T need it)
    // you'll send bytes or messages to the server in
    // the OutputStream and receive answers from the
    // server in the InputStream
    int packetOutputBufferSize = connection.getSendBufferSize();
    int packetInputBufferSize = connection.getReceiveBufferSize();
    BufferedOutputStream bos = new BufferedOutputStream(connection.getOutputStream(),packetOutputBufferSize);
    BufferedInputStream bis = new BufferedInputStream(connection.getInputStream(),packetInputBufferSize);
    // sending data through the socket
    // create your packet in a byte array
    byte[] output = new byte[<packet-lenght>];
    output[0]=<packet ID>
    output[1]=....
    bos.write(output,0,output.length);
    // receiving data from the socket
    byte[] input = new byte[<max-packet-length>];
    int read=0;
    int length=0;
    while ((read=bis.read(input,length,(input.length-length)) > 0) {
    length+=read;
    if (length>=input.length) break;
    // now your server output is in the bytearray 'input'
    If it isn't possible to set a max packet size, use a bytearray as buffer and write it content into a ByteArrayOutputStream, thats something like a resizable write-only byte array. (you'll get the full content of it by calling the method ByteArrayOutputStream.toByteArray())
    Maybe you want to check the packet content during receiving the bytes from the socket: Then you should use some read() method from the InputStream, but thats not very powerful.

  • 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}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Socket read exception

    Hi!
    I have a client (an applet) which communicates with a server via socket. It works like a charm in most cases. However, sometimes when the connection is slow I get an IOException. If I print the message provided with the IOException it look like:
    Socket read exceptionWhat does this really mean? The reason why I'm asking this question, is that the server programmers are non Java programmers. Could someone give me some more information that could be useful?
    BTW. The SO_TIMEOUT is 0 (the default).
    Regards
    Johan

    Which JVM are you using? Occasionally with a microsoft JVM this exception seems to be retriable, so I allow up to three. However, you would normally expect it to be terminal, since the TCP implementation itself should handle all possible retries.
    Sadly the server may not detect the failure of the socket, unless your protocol includes some sort of PING/ keepalive. *nix servers seem particularly bad at detecting the closing of a socket.
    Windows by deault hangs up if your internet connection is not busy, you may need to change this option in IE.
    You mention that this error is more common at busy times. You may find that your network includes some sort of load balancer that closes sockets that it considers idle - this is not uncommon.

  • Unable to read field value from main table - unexpected socket read error

    Hi Friends,
    While executing the below code, I am able to get the value of the field 'id' but i am unable to get the value for the 'materialnumber' field. i am getting the below exception
    +com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ProtocolException: java.io.IOException: Unexpected socket read.  Result is -1.
         at com.sap.mdm.data.commands.AbstractRetrieveLimitedRecordsCommand.execute(AbstractRetrieveLimitedRecordsCommand.java:158)
         at com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand.execute(RetrieveLimitedRecordsCommand.java:157)
         at updaterecords.main(updaterecords.java:126)
    Caused by: com.sap.mdm.internal.protocol.manual.ProtocolException: java.io.IOException: Unexpected socket read.  Result is -1.
         at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:100)
         at com.sap.mdm.data.commands.AbstractRetrieveLimitedRecordsCommand.execute(AbstractRetrieveLimitedRecordsCommand.java:146)
         ... 2 more
    Caused by: java.io.IOException: Unexpected socket read.  Result is -1.
         at com.sap.mdm.internal.net.DataSocket.receiveData(DataSocket.java:59)
         at com.sap.mdm.internal.net.ConnectionImpl.readInt(ConnectionImpl.java:417)
         at com.sap.mdm.internal.net.ConnectionImpl.nextMessage(ConnectionImpl.java:501)
         at com.sap.mdm.internal.net.ConnectionImpl.receiveMessage(ConnectionImpl.java:472)
         at com.sap.mdm.internal.net.ConnectionImpl.send(ConnectionImpl.java:209)
         at com.sap.mdm.internal.net.ReservedConnection.send(ReservedConnection.java:105)
         at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:97)
         ... 3 more+
    import com.sap.mdm.commands.AuthenticateUserSessionCommand;
    import com.sap.mdm.commands.CommandException;
    import com.sap.mdm.commands.CreateUserSessionCommand;
    import com.sap.mdm.commands.DestroySessionCommand;
    import com.sap.mdm.commands.GetRepositoryRegionListCommand;
    import com.sap.mdm.data.Record;
    import com.sap.mdm.data.RegionProperties;
    import com.sap.mdm.data.ResultDefinition;
    import com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand;
    import com.sap.mdm.ids.TableId;
    import com.sap.mdm.net.ConnectionException;
    import com.sap.mdm.net.ConnectionPool;
    import com.sap.mdm.net.ConnectionPoolFactory;
    import com.sap.mdm.schema.FieldProperties;
    import com.sap.mdm.schema.RepositorySchema;
    import com.sap.mdm.schema.commands.GetFieldListCommand;
    import com.sap.mdm.schema.commands.GetRepositorySchemaCommand;
    import com.sap.mdm.search.Search;
    import com.sap.mdm.server.DBMSType;
    import com.sap.mdm.server.RepositoryIdentifier;
    public class updaterecords {
         public static void main(String[] args) {
              try {               
                    String serverName = "159.112.6.26";
                    ConnectionPool connections = null;
                    try {
                         connections = ConnectionPoolFactory.getInstance(serverName);
                    } catch (ConnectionException e) {
                         e.printStackTrace();
                         return;
                   // specify the repository to use
                   // alternatively, a repository identifier can be obtain from the GetMountedRepositoryListCommand
                   String repositoryName = "DEMO";
                   String dbmsName = "MDMD";
                   RepositoryIdentifier reposId = new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.ORACLE);
                   // get list of available regions for the repository
                   GetRepositoryRegionListCommand regionListCommand = new GetRepositoryRegionListCommand(connections);
                   regionListCommand.setRepositoryIdentifier(reposId);
                   try {
                        regionListCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   RegionProperties[] regions = regionListCommand.getRegions();
                   // create a user session
                   CreateUserSessionCommand sessionCommand = new CreateUserSessionCommand(connections);
                   sessionCommand.setRepositoryIdentifier(reposId);
                   sessionCommand.setDataRegion(regions[0]); // use the first region
                   try {
                        sessionCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   String sessionId = sessionCommand.getUserSession();
                   // authenticate the user session
                   String userName = "meter1";
                   String userPassword = "meter1";
                   AuthenticateUserSessionCommand authCommand = new AuthenticateUserSessionCommand(connections);
                   authCommand.setSession(sessionId);
                   authCommand.setUserName(userName);
                   authCommand.setUserPassword(userPassword);
                   try {
                        authCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   GetRepositorySchemaCommand cmd=new GetRepositorySchemaCommand(connections);
                   cmd.setSession(sessionId);
                   try{
                        cmd.execute();               
                   }catch(CommandException e){
                        System.out.println(e.getLocalizedMessage());
                   RepositorySchema repsch=cmd.getRepositorySchema();
                   // the main table, hard-coded
                   TableId mainTableId = new TableId(1);     
                   // specify the result definition (what to retrieve); in this example, nothing
                   ResultDefinition rd = new ResultDefinition(mainTableId);
                   // select all records
                   Search search = new com.sap.mdm.search.Search(mainTableId);
                   //get fields
                   GetFieldListCommand getFieldListCommand = new GetFieldListCommand(connections);
                   getFieldListCommand.setSession(sessionCommand.getUserSession());
                   getFieldListCommand.setTableId(mainTableId);
                   try {
                        getFieldListCommand.execute();
                   } catch (CommandException e) {
                        System.out.println(e);
                   FieldProperties[] lookupFields = getFieldListCommand.getFields();
                   // add fields to records to retrieve
                   rd.addSelectField(repsch.getFieldId("Products","Id"));
                   rd.addSelectField(repsch.getFieldId("Products","MaterialNumber"));                              
                   // retrieve the records
                   RetrieveLimitedRecordsCommand limitingCommand = new RetrieveLimitedRecordsCommand(connections);
                   limitingCommand.setSession(sessionId);
                   limitingCommand.setResultDefinition(rd);
                   limitingCommand.setSearch(search);
                   //limitingCommand.setPageSize(2000);
                   try {
                        limitingCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   System.out.println("Record count is " + limitingCommand.getRecords().getCount()+"\n");
                   Record[] records=limitingCommand.getRecords().getRecords();
    System.out.println(records[0].getFieldValue(repsch.getFieldId("Products","Id"))+ " \n");
    System.out.println(records[0].getFieldValue(repsch.getFieldId("Products","MaterialNumber"))+ " \n");
                   // finally destroy the session
                   DestroySessionCommand destroySessionCommand = new DestroySessionCommand(connections);
                   destroySessionCommand.setSession(sessionId);
                   try {
                        destroySessionCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
              } catch (Exception e) {
                   System.out.println(e.getLocalizedMessage());
                   e.printStackTrace();
    Kindly let me know where i am going wrong. MaterialNumber field is a TEXT not a lookup table field.  Above fields are from the main table.
    Thanks,
    Raags

    Hi Friends,
    I got the solution. It was the error because of not having a the below statement.
    limitingCommand.setPageSize(1);
    As i havent used that statement, it was trying to get 1000 records, and i dont know exactly what makes this to get that error. Anyhow., As i want to use for updation, i cn live with one record.
    Thanks,
    Raags

  • Please read my question carefully, this is, I think, a question for the experts. It's not the usual name change question.   When I setup my new MacBook Pro, something slipped by me and my computer was named First-Lasts-MacBook-Pro (using my real first and

    Please read my question carefully, this is, I think, a question for the experts. It's not the usual name change question.
    When I setup my new MacBook Pro, something slipped by me and my computer was named First-Lasts-MacBook-Pro (using my real first and last name).
    I changed the computer name in Preferences/Sharing to a new name and Preferences/Accounts to just be Mike. I can right click on my account name, choose advanced, and see that everything looks right.
    However, If I do a scan of my network with my iPhone using the free version of IP Scanner, it lists my computer as First-Lasts-MacBook-Pro! And it lists the user as First-Last.
    So even though another Mac just sees my new computer name, and my home folder is Mike, somewhere in the system the original setup with my full name is still stored. And it's available on a network scan. So my full name might show up at a coffee shop.
    Can I fully change the name without doing a complete re-install of Lion and all my apps?

    One thought... you said the iPhone displayed your computer's old name? I think that you must have used the iPhone with this computer before you changed the name. So no one else's iPhone should display your full name unless that iPhone had previously connected to your Mac. For example, I did this exact same change, and I use the Keynote Remote app to connect with my MacBook Pro. It would no longer link with my MacBook Pro under the old name, and I found that I had to unlink and then create a new link under the new name. So the answer to your question is, there is nothing you need to do on the Mac, but rather the phone, and no other phone will display your full name.

  • Socket read error: connection reset by peer

    Hi.
    Has anybody experienced the error message �Socket read error: connection reset by peer�
    Please see below for detailed information.
    Appreciate your help
    Regards
    RT
    Enviroment specification
    Server: HP/UX 11.00 64-bit, Oracle RDBMS 8.1.6.0.0 64-bit
    2 firewalls between client and db.
    Client:
    Win 2000,
    SP3,
    Oracle Client 8.1.7.0.0 ,JDBC OCI (thin JDBC driver,class12.zip)
    JDK 1.3
    JRUN3.0
    The TCP protocol is being used in the communication
    Error messages
    Web Users receive:           Socket read error: connection reset by peer
    Trace files on the sever:      Read unexpected EOF ERROR on 18.
    Explanation: The error in the server sqlnet trace file, suggests that a client connection has terminated abnormally, i.e. client machine powered off, a cable removed or a network connection aborted without warning. No user has complained of such a problem and there is no client trace with an error.
    The problem
    The users of the java web application, experiencing an exception almost once or twice a day.
    The JRUN web-server reports broken connections to the db and client are receiving "connection reset by peer".
    At the moment when the errors occurs the users just have to wait a while(2-10 min) and then they can use the web application again.(no action is taken)
    This problem can not be reproduced. The problem happens only occasionally when the network is under heavy load and new DB connection is being created.
    The application
    The java web-application uses a customized connection pooling against the database. This pool is shared among all the users of the website. whenever a user process needs to fetch data from the database, a free connection from this pool is allocated. The application is testing if the connection is valid before making a transaction (select '1' from dual). When the error occurs a ORA-3113 end-of-file on communication channel is returned to the application.
    The path between the client and db involves at least two firewalls. The firewalls are opened for sql*net traffic. The network group can tell that enquiries from the app.server is not getting feedback from the db. They have not however, identified if the enquiries are reaching the db-srever, or if they are stopped earlier in the network.
    Around 1000 users, are using other applications which uses dedicated sqlnet connections against the db and they have not experienced any problems.
    Issues considered
    Connection pooling
    It is a customized connection pooling, developed by Lindorff developers.
    I have read through the source code for the connection pooling and it does the job as it should, and in case of bad connection, it tries to create a new connection.
    The log file shows that the call to the method DriverManager.getConnection() hangs until the server goes down, which is probably because of the fact that the method DriverManager.setLoginTimeout(), does not take effect and timeout value is Zero. ( According to oracle , Oracle JDBC does not support login timeouts and calling the static DriverManager.setLoginTimeout() method will have no effect).
    Firewall
    One thing to consider is when the firewall may decide to shut down the socket due to long inactivity of a connection. This will cause problems to JDBC Connection Pool because the pool is not aware of this disconnection at the TCP/IP level; until someone checks out the connection from the pool and tries to use it. The user will get a Socket read error: connection reset by peer.
    Jrun timeout paramter is less than the firewall�s timeout so the firewall will not close a connection before Jrun does.
    Number of processes the DB can handle
    Processes parameter is 1300, , they have not experienced the Oracle error msg �max # of processes reached�.
    Port redirection through a firewall:
    Since the firewall has a sql net proxy Port redirection through a firewall is not a problem. Problems with port redirection only appear at connect time, but in this situation the connections fail long after the connection is established.
    The network group
    The network people who investigaged the problem at Lindorff report that there are a significant amount of "dropped packages" between the database server and the jdbc client (web-application) 24 hrs. The reason for this is "unknown established TCP packet" which means that the firewall does not consider these packages to be part of an already established session. The network group believes this happen because one of the hosts send a RESET or FIN signal which the firewall have noticed but are not received by the other host.
    It seems like the firewall are dropping packages bacause of "Unknown
    established TCP packet" from both the JDBC client and the TNSLISTENER on the database server. The dropped packages are SQL*Net v2 traffic so clearly Oracle products are involved

    Presumably something is working.
    Thus the problem is not with your code. At least not the database part that you have control over.
    That error occurs when the other side closes the socket. Presumably you are catching lost connection exceptions and trying to restore it.

  • My MacBook Pro is running VERY slowly. After reading other questions and responses, I ran an EtreCheck, but do not know how to post the report here. Any help would be greatly appreciated.

    My MacBook Pro is running VERY slowly. After reading other questions and responses, I ran an EtreCheck, but do not know how to post the report here. Any help would be greatly appreciated.

    My MacBook Pro is running VERY slowly. After reading other questions and responses, I ran an EtreCheck, but do not know how to post the report here. Any help would be greatly appreciated.

  • I've read similar questions and answers, but I am still terrified to upgrade from leopard to snow leopard. The only reason I want to is because I received an iPad which requires an updated system. I have an external hard drive. I have the disks to upgrade

    I've read similar questions and have studied the answers, but I am still terrified to upgrade from leopard to snow leopard on my macbook pro. The only reason for doing it is in order to sync my macbook pro with my iPad. I do have an external drive which automatically backs up every hour. BUT.......I am techno-ignorant as well as techno-paranoid. I have the disks to update to snow leopard but knowing doing so may likely change/alter/lose/obliterate my current set-up, it actually makes me feel sick to think of it.
    Years ago when updating via Apple Protection Plan tech support, my screen actually went blank, everything gone! The tech told me not to worry, that "we" would be able to restore things, but several hours later I was still looking at a primitive looking screen that wasn't anything like what I had before. His language was too technical, in that there was an assumption I understood things I had zero understanding of. Example: partition my external drive.
    Anyway, living hundreds of miles from an Apple service provider, and no Apple techs in my community, I had to wait for a trip to an Apple Store where one of the wonderful guys at the genius bar spent a ton of time getting things back to normal and actually explaining it enough that I had a vague understanding.
    So now I am in the predicament again and won't know what to do after installing the new disks and finding a likely mess or absence of documents etc. on my computer. I don't know how to access the external drive, and even if I did I wouldn't know how to move stuff from that to my computer.
    Anyone have any suggestions?

    I'm in the same boat as you, I've used Mac's since day one and neglected my Windows education and now it has come to haunt me as I have to learn it like a school kid.
    Nearly 99% of all businesses and nearly 95% of everyone use Windows, Steve Jobs declared "The desktop wars are over, Microsoft won" a long time ago.
    By 2015 tablets are going to be selling to consumers more than traditional computers, your living proof, you got a iPad.
    Apple has already discontinued the Xserver, the Xraid, the MacBooks and the 17" Macbook Pro.
    Apple has introduced BootCamp in OS X 10.6 and up, this allows a partition and drivers so one can install Windows on a Mac.
    https://www.apple.com/support/bootcamp/
    Why do you think they named it "BootCamp"
    You can't run a older OS X version longterm like you have with 10.5 anymore, Mac's are being targeted for attacks and older OS X versions are dropped for security updates.
    In fact your Mac might still be part of the 750,000 Mac strong Flashback botnet or infected.
    https://en.wikipedia.org/wiki/Trojan_BackDoor.Flashback
    http://arstechnica.com/apple/2012/04/how-to-check-forand-get-rid-ofa-mac-flashba ck-infection/
    See here, Apple has no security updates for 10.5 users and soon 10.6 is going to be ignored next.
    https://support.apple.com/kb/ht1222
    1-1.5 years is the OS X upgrade cycle. Change everytime like it or not.
    So I'm thinking about your long term future and how you obviously don't like change, need local assistance like it appears you first claimed.
    So buy a new Mac and upgrade your OS X version whenever Apple shows it in AppStore.
    When your machine can no longer upgrade to the newest OS X version, then you've got about another 2 more years of security updates before you have to buy a new machine or risk running a insecure one.
    Learn here how to go about fixing your own machine and creating backups/bootable clones this way your not having to drive several hundred miles for a software or boot drive repair. Simply reverse clone your troubles away.
    Most commonly used backup methods
    https://discussions.apple.com/community/notebooks/macbook_pro?view=documents
    I'm of the maturity and experience that I know a Mac isn't always the best solution for everyone and even Apple doesn't provide the proper hardware, support or features for everyone. Why only store locations in high traffic ritzy areas?
    Our SteveJobs fan here is under 18 years old with good eyes, he's not older like we are with bad or failing eyesight.
    The new Mac's  have hard to see glossy screens and the type/UI can't be scaled up easily to accomadate our older eyes, however a Windows 7 machine does allow up to 150% scale of the UI, type etc., and also there are anti-glare screen PC's and just about no more anti-glare screen Mac's.
    I wrote this User tip in case you have trouble seeing the screen, at least you can scale the web browsing up
    Web browsing for hard of seeing users
    Apple might still be selling the anti-glare 15" non-retina on their online store, it's the "high resolution/anti-glare model"
    But I can get a 17" 1080i HD anti-glare Windows 7 laptop at Sager for a lot more performance and screen size for the price than a Mac.
    https://www.sagernotebook.com/index.php?page=category_browse&selected_cat=2
    Screen size is important as the UI and text can be scaled up for easier reading.
    Of course you do now have the option of having Windows pre-installed alongside OS X to begin your transition to the dark side.
    Just call and they will accomondate, hold the option/alt key at boot time to swtich operating systems.
    http://www.macmall.com/
    Windows 7 looks just as good as OS X, the secret is having a good monitor with most PC's come with don't.
    Good Luck and I hope I've given you a lot to think about.

  • Socket read() call returning before timeout.

    I have a couple of applications which use the following basic socket reading approach:
    Socket socket = new Socket("192.168.0.1", 54321);
    socket.setSoTimeout (5000);
    InputStream stream = socket.getInputStream();
    byte[] data = new byte[232];
    boolean done = false;
    while (!done) {
        int res= stream.read(data);
        if (res < data.length) {
            System.err.println ("Error reading packet data - not enough data received: "+ res);
        // process and output the data
    try { stream.close(); } catch (Exception e) {}
    try { socket.close(); } catch (Exception e) {}The problem I am having is that sometimes read(byte[]) returns a before the full array's worth of data has been read, and before a timeout has occurred. I never get a SocketTimeoutException, but I do get my debugging output. I have recorded the network traffic with a packet sniffer (Wireshark), and what I am seeing is that in the instances where the read returns prematurely, it stops at the end of a TCP packet. The rest of the data is in another packet that arrives shortly afterwords (~1.5 ms or less).
    I know that with normal (file) input streams, read can return whenever it wants regardless of how many bytes were read, however I was under the impression that network streams are supposed to block until all the data arrives (or a timeout occurs, if set). Is this incorrect?

    djpeaco wrote:
    I know that with normal (file) input streams, read can return whenever it wants regardless of how many bytes were readThat's correct and that's exactly the reason you see the behavior you see.
    however I was under the impression that network streams are supposed to block until all the data arrives (or a timeout occurs, if set).Why? Why do you think that network streams behave differently in this regard?
    Why shouldn't it give you the data as soon as it's available, when every other stream works this way?
    Is this incorrect?Yes, you must assume that the streams of a socket follow the general InputStream/OutputStream contract and that includes possibly returning from read() before the full array is filled.

  • Socket reading -writing

    hello friends i am new to this forum and looking forward for some help from you guys
    suppose i open a socket and made a connection to the remote server
    now i have one socket with me and another corrresponding socket with the server .i write a very long string containig
    new lines out.println("vey long string");
    and i close the socket or the function in which i am doing this job exits.
    would the remote server able to read from its socket or not that is does the closing of socket on one side closes the whole connection.

    if its a TCP socket if you close one side the connection is closed, so it will not be able to read from its socket.

  • 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

  • Socket Read Timeout error in weblogic logs happening every 30 min

    One of my customer is getting Socket Read Time out error, when creating connection pool.
    java.sql.SQLException: Socket read timed out
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:135)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:203)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:489)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:439)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:640)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:205)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:554)
         at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(ConnectionEnvFactory.java:327)
         at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:227)
         at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1193)
         at weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.timerExpired(ResourcePoolImpl.java:2451)
         at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused By: oracle.net.ns.NetException: Socket read timed out
         at oracle.net.ns.Packet.receive(Packet.java:333)
         at oracle.net.ns.DataPacket.receive(DataPacket.java:94)
         at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:176)
         at oracle.net.ns.NetInputStream.read(NetInputStream.java:121)
         at oracle.net.ns.NetInputStream.read(NetInputStream.java:96)
         at oracle.net.ns.Packet.extractData(Packet.java:443)
         at oracle.net.ns.AcceptPacket.<init>(AcceptPacket.java:108)
         at oracle.net.ns.NSProtocol.setNetStreams(NSProtocol.java:697)
         at oracle.net.ns.NSProtocol.connect(NSProtocol.java:386)
         at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1088)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:305)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:642)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:205)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:554)
         at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:227)
         at weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.timerExpired(ResourcePoolImpl.java:2451)
         at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Any suggestions?

    Could be a firewall rule terminating an idle connection?

  • 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.

  • 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

Maybe you are looking for