Using plain Java Sockets(not RMI) how..?

hi!
1. Using plain Java Sockets(not RMI) how can the client detect when its server
goes down?
There is a long time interval between client requests and the client wants
to retain a live connection rather than disconnect after every reqest.
Please also cc your reply to [email protected]
Thanks,
\Raghu

If you try to send data when the host is gone, it throws an exception. I don'thow to check if it is alive though. I'm having the same problem right now.

Similar Messages

  • I have dragged 2 files to the trash bin but I cannot delete them from the trash bin. It keeps telling me these files are in use when they are not. How do I delete these files? One is a txt file and the other is an xls file

    I have dragged 2 files to the trash bin but I cannot delete them from the trash bin. It keeps telling me these files are in use when they are not. How do I delete these files? One is a txt file and the other is an xls file

    From the Finder menu select 'Secure Empty Trash'. If this or the suggestion above doesn't resolve the problem take a look at the various suggestions in this link:
    http://www.thexlab.com/faqs/trash.html

  • Java socket not handling the data packets properly

    I have created a small webserver application where i am receiving http requests from a siebel client. I am using content-length parameter to read the complete data in a buffer string using the command inputstreamreader.read. It works fine in all the cases, except when its used with a firewall. Some times the firewall splits a message into 2 and my logic fails as it doesn't find as many characters in the first packet as mentioned in the content length.
    My question is , how can i take care of these scenarios where a firewall is splitting the messages into multiple packets. why the java socket class is not handling the merging of these packets?
    any pointers are welcome.
    thanks

    Because that's the way TCP/IP works. read() gives you the data it can, and tells you how much was actually read. It's up to the application to reconstruct the application-level object. You could do something like this:    byte[] content = new byte[contentLen];
        int offset = 0;
        int remaining = contentLen;
        int currBytesRead = 0;
        while (remaining > 0 && currBytesRead != -1) {
          int currBytesRead = mySocketInputStream.read(content, offset, remaining);
          remaining -= currBytesRead;
          offset += currBytesRead;
        } (Warning: that's off the top of my head, uncompiled and untested. Use for demonstration purposes only!)
    Grant

  • I need java 1.5.0_10 to work or i can't use firefox,java is not in blocklist, now what?

    I need this java to use for work related programs, i had it, it auto updated, i uninstalled and installed the version that i need. It (java) does not appear in the blocklist to enable.

    ty for your reply, unfortunately i have no control over the version of java used. so essentially, i need to find an older version of firefox that will use java 5 or firefox becomes a filebox for google docs.

  • My software update is complete but it appears that my Java is not working, how should I correct this?

    I'm trying to upload my pictures to a different site which requires Java.  I checked Java.com which states that Apple has it's own version of Java, but my computer will not allow me to upload my pictures even though my software is updatede.  Does this mean I don't have Java? If so, how do I get it for my laptop?

    you can try this,  on your phone, go to the app store, hit the update button on the bottom, then click on purchase, you will then see 2 tabs all/or not on this phone.   Look and see if your app is there, if it is hit the cloud icon next to it and it will download to your home screeen.

  • My ipad has been disabled and my computer that i use with it is not working, how do i restart it?

    I have an ipad 1 that was jailbroken and i downloaded an app and pressed a lot of buttons and then my iPad was locked. I cant unlock it so how do i reboot it when the computer i usually use with it is not currently working? I really need help!
    Thx in advance,
         abigail

    You are in the wrong forum if your device has been jail broken. Issues with jail broken devices are not to be discussed on the ASC site. You should probably try another forum.

  • Simple P2P, which should I use: JXTA, JMS, Sockets, CORBA, RMI?

    Hello,
    I�m going to develop a peer-to-peer application that has the following functionality:
    - every peer computes results and then sends them to a specific other node
    - every peer receives results from other peers and stores the results
    - peers send lookup messages, if another peer already stored information
    My wishlist:
    - fast reliable communication
    - no big framework
    - auto-discorvery and lookup of the peers
    I�ve already looked at JXTA, but it seems to be too big for my needs.
    I�m scared to find out, that it performs bad for my situation after 4 weeks implementing.
    Maybe Java Message Service is the right thing? But I don�t want the complete J2EE crap.
    Or should I do it the hard way myself with simple Sockets and an own Protocol?
    I think RMI/Corba is bad, because it has a Client/Server structure and what I need is a Server/Server solution (P2P).
    Ideas and suggestions, please! :)
    Thanks for your help.

    Tirador wrote:
    It is LAN only. We are talking about 10-100 peers. The thing is, that I�ve data results that are exchanged in the range of some millions (limited by each machines memory). I think due to big traffic and millions of message (even if buffered and sent in one packet) RMI could be too bad, or?Is this a commercial application? Sounds like you might be able to use something like JGroups, http://www.jgroups.org/javagroupsnew/docs/index.html

  • I am having trouble completely emptying my trash on my mac.  It says items are in use, but they are not.  How do I force these items to be removed?

    I have copied dvds that I own, for backup copies, onto the desktop of my macbook.  Then I've placed a copy into iTunes for viewing later.  Once the copy is over in iTunes, I delete the copy of the movie on the desktop and it goes to the trash.  I do this because 1) I don't want to clutter up the desktop and 2) I don't want multiple copies of the movies on my hard drive.  When I go to empty the trash, it says these items are in use and will not remove them from trash.  Why is that?  They are not in use as far as I know.  How do I force them to be removed from trash?

    I had a similar problem.  I think it was caused by deleting an app while it was still running. I should have shut the app down before deleting freom the applications folder.  When I tried to empty trash I received message:
    "The operation can't be competed because the item something.app is in use."
    Go to utilities, open a terminal, change directory to the hidden Trash folder and remove the offending item in use. Example:
    cd ~/.Trash
    sudo rm -rf item
    Next time, maybe try quting iTunes before deleting and see if it makes any difference.
    http://www.macworld.com/article/2025381/mac-troubleshooting-what-to-do-when-the- trash-won-t-empty.html
    Another approach might be to use the iTunes folder named "Automatically Add to iTunes" folder.
    http://support.apple.com/kb/HT3832?viewlocale=en_US&locale=en_US
    -Ed

  • I have sent a file to the trash bin. When I come to empty the trash bin everything goes out except this one particular file and I get a note saying the file is 'in use' but it is not. How can I delete this file from trash?

    I have a Macbook Pro with OS X Lion 10.7.2. I have sent a work file to the trash bin along with many other files. When I empty the trash this one particular file remains and I get a message that this file is still in use. I have tried returning the file to my documents, opening it, closing it and then sending it to trash and again I try to empty trash but the same message comes up - Q - How can I trash this file permanently?

    First just try logging out and back in.  Whatever is holding on to it may not be running after the logout thus freeing it so you can trash it after logging back in.
    You might also try Trash It!
    Lastly, look at the following for suggestions:
    The X Lab: Solving Trash Problems

  • Trying to set up an apple id for my daughter but it says that the apple id already exists...but it shouldnt as she has been using my account! not sure how to solve this problem ??

    I have an apple id myself which my children share, i am trying to set up an apple id for my daughter but it says that the id already exists?? which it shouldnt!
    I have tried taking her Mac and ipod off my devices but it still wont let me set it up!! any ideas anyone??

    Hello, Wyseup. 
    Thank you for visiting Apple Support Communities.
    Most likely this email address has been attempted to be setup as an Apple ID at some point.  You can reset your Apple ID password via the steps in the first article below.  If you do not have access to the email account, need assistance or are not receiving the password reset link, see the second article.
    Apple ID: If you forget your password
    http://support.apple.com/kb/ht5787
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Cheers,
    Jason H.

  • How to monitor perticuler sql statement using the INDEX or not?

    I am running on a long running quary, and the output is comming very late. So i want to know the sql quary is using the index or not? How to know that?

    If you want to check the real execution plan of a running query without waiting for query completion, you can try following steps that you should adapt to your query and your environment:
    1. start the query
    select
    count(*)
    from all_objects, all_objects;2. Retrieve in another session the SQL_ID and the CHILD_NUMBER of the running query:
    select sql_id, child_number, sql_text
    from v$sql
    where sql_text like '%all_objects%';3. use DBMS_XPLAN.DISPLAY_CURSOR to get the real execution plan from shared pool using SQL_ID and CHILD_NUMBER from step 2:
    select * from table(dbms_xplan.display_cursor(<sql_id>,<child_number>));Actually you don't need to restart the query if it is already running because the hint GATHER_PLAN_STATISTICS is only needed if you want to have current execution statistics.
    Edited by: P. Forstmann on 2 mars 2011 10:23

  • Can Java reflect not only .Class file

    Hi' i'm newbie in this topic, i'm really appreciate if somebody can help me..cos i'm really stuck in here...
    My Problems are :
    1. i want to ask about this, can Java reflect from .java file?
    2. i'm using Eclipse IDE, i'm really interesting about how JTree or Package Explorer in Eclipse can always displaying update information about class structure? but .java files not compiled, how can? if Eclipse using reflection, .java files must be compiled first, correct me if i'm wrong?
    The fact is Eclipse don't have to compiled .java files to get the update information about class structure and displaying in JTree or package Explorer...how implement like this?
    what i mean like this :
    ex : if i type int x = 100; (not only int, it could be anything else..) at the working files, JTree or Package Explorer in Eclipse can always update the informasion about class structure, but .java files not compiled..
    i hope my question are easy to understand, i really need some help..
    Thanks a lot..

    hey, thanks for the answers, but i would like to ask :
    1) Eclipse performs background compilation of the Java sources, then performs reflection on those temporary classes++ if i'm using this way, how about the performance? seems that it will be compiled all the time right?
    2) Eclipse has access to the results of the Java source code parser, and can extract the information from the java syntax parser, before it gets to the compilation stage.++ how to implement this? what do you mean about java syntax parser?
    do you know where i can find any article about this?
    thanks a lot again...

  • How can I get past prob using MQ Java classes on HPUX (CCSID 1051 not sup)

    I am working with MQSeries (Java classes for MQSeries MA-88) in an HP-UX environment.. I am not able to get from a queue using Java because apparently Java does not support code page 1051. Is there a way to get around this? I don't have the option of changing the default CCSID of the queue manager. I have heard something about being able to map CCSIDs using an HP-UX system call thru JNI but no details.. Any info would be appreciated.. What I am getting back from Java is "unsupported character set 1051" this is the default for HP-UX

    Hi All,
    I am facing the same problem.
    Has some one found a solution or work around for this problem.
    Please reply ASAP.
    TIA
    Anup B Darvatkar
    ([email protected])

  • Java does not work at all upon using the update manager to update to firefox 3.6.10 for Ubuntu 9.0.4

    OS: Ubuntu 9.0.4
    Browser: Firefox 3.6.10
    upon updating to firefox 3.6.10, java does not work at all.
    websites that use java do not work at all anymore, when they worked just fine before the updating thru update manager. e.g. hulu website cannot play any of the shows.
    i can give the folder of bookmarked pages i tried.
    how to do that on here, i've yet to see if possible.
    i can even give saved text from the terminal concerning certain attempts.
    when i updated thru update manager, it gave some weird java plugin that wasn't there before "The IcedTea Web Browser Plugin IcedTea6 Java Web Browser Plugin (execution of applets on webpages)".
    i uninstalled this as instructed by an answer found in one of the pages i saved, cuz it was conflicting w/another java program the updater said i needed. right now, i don't remember for sure what it was. it perhaps was realplayer flash or Java itself. w/all the hours/days of searching i put in, it's difficult if not downright impossible for me to remember all the specifics of what i tried.
    i've searched throughout many webpages (including many searches on mozilla, ubuntu, java, etc) for instruction in fixing the problem.
    oh, and incidentally, on the Java site, when i try the verify test of Java, firefox pops up with that yellow bar right below the slew of tabbed website windows, giving the statement "additional plugins are required to display all the media on this page. (w/link to) install missing plugins ." which is what i do, go thru the requesting plugin installation. it comes up with, guess what, the IcedTea Java Plugin. i click on the 'next' in the "Plugin Finder Service" box that pops up, & all it gives me is "No plugins were installed. IcedTea ...Plugin failed. and the link 'find out more about plugins or manually find missing plugins'". the link takes me to some of the very things/plugins that wouldn't install in the first place. the Java test failure is a LOL funny, as what plugin it is saying is required (IcedTea) is a recommended alternate program to display the very test in the first place.
    i followed the given instructions on those many searched pages, in every case (barring what i may have just plain missed), but to no avail.
    i've even gone to the point of trying to reinstall the previous 3.5.13 firefox version, from mozilla site. even that wouldn't install.
    i've tried installing Java for my sys direct from it's site. nada.
    now it's time for me to post the problem & perhaps someone will come up with some kind of "dummy" way to fix it.
    until then many sites a regularly use are totally useless to me on this fast puter.
    the only way i can get to use such sites, are two choices: 1. use a dinosaur laptop, which is slower than molasses & cannot handle to any streaming stuff, or 2. use an available internet access puter at the library. but useage for ea person per day is limited to only one hour a day. and one can end up waiting for an hour or more ( in the busiest periods) to even get to use one.
    so, is there anyone at all, who knows any for-sure working fix for this problem?
    thanks muchly :^D
    p.s. i can't pay anybody any money for such help, as is required in certain sites (e.g. Java website), cuz i don't have any.
    i can pay in labor tho, if there is someway to find someone who can physically be at this puter w/me, taking me step-by-step
    sorry for the 20-pg essay. i hope it was all clearly understood. if, not, well, clear communication is always what is needed, ask away.

    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Shockwave Flash 9.0 r999
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    In Firefox 3.6 and later versions you need the Next-Generation Java™ Plug-In present in Java 6 U10 and later (Linux: libnpjp2.so; Windows: npjp2.dll).
    http://java.com/en/download/faq/firefox_newplugin.xml
    See also http://java.sun.com/javase/6/webnotes/install/jre/manual-plugin-install-linux.html

  • Java Sockets - help with using objects

    I am new to java sockets, and need to come up with a way to send a user defined instance of a class across a basic client/server application.
    I can not find out how to do this. I read the tutorials, but my class can not be serialized. How can I send/recieve this instance of a user defined class?

    right off the top of my head, doesn't serialver just spit out a UID for a given set of classes?
    To mark a class as Serializable, just implement the java.io.Serializable class - then you could use the readObject/writeObject methods of the ObjectInputStream/ObjectOutputStream classes.
    Good luck
    Lee

Maybe you are looking for

  • Dynamic Distribution Group set conditions by importing text file?

    Exchange 2010 SP2. I created a dynamic distribution group via the EMC.  We have populated AD with ExtenstionAttribute1 and ExtensionAttribute2.  I have created the ddg with custom attribute1 value = employee.  What I need to do now is  populate custo

  • Are there more any free instrument downloads

    I have the basic ones that came with the computer, but on the video tutorials it shows alot more. Are they on expansion packs or are there some free to download

  • Lion Mail 5.0 Subject text behind button

    When creating a new message in Mail, I see the word "Onderwerp" (Dutch for Subject) is partially behind the button for extra options (see picture below) I tried resizing the window, restarting Mail, rebooting, but it's still like in this picture. Cur

  • Material Type configuration changes

    Friends, We have a requirement to change the material type configuration from valuated to non valuated. I performed this change in sandbox and the system allows me to change the configuration. There are some impacts of doing that like we need to kill

  • Error code 205.  Comdo

    Error code 205 when installing.  Comco antivirus and windows firewall have been disabled.  However, still some files blocked by Comdo and can't get them unblocked b/c Comodo says Adobe are already on the trusted list.  Any suggestions?