Stop blocking read from a socket but still preserve it

Hello, I have a thread waiting for a socket input...in case I wanted to stop it I need a way to stop blocking receive, but not something like close() or shutdownInput() because I don't want to close the socket but simply shut down the thread...any ideas?

It sounds like you need to set a socket read timeout: see Socket.setSoTimeout(), but exiting the thread and leaving the socket to another thread doesn't sound right. Normally the thread is dedicated to looking after that socket.

Similar Messages

  • My adobe reader does not read my pdf files, I think it was screwed up by the other "PDF-READER". I deleted the other "PDF-READER" from my pc, but it still does not work.

    my adobe reader does not read my pdf filI think it was screwed up by the other "PDF-READER". I deleted the other "PDF-READER" from my pc, but it still does not work.

    Hi wellsfar,
    Which version of Adobe Reader you are using?
    Is it showing any error message?
    A screenshot of the error would be more helpful.
    Regards,
    Florence

  • My daughter has an iPod touch using my apple ID, I just purchased an iPhone with the same ID. Is there a way to keep my stuff seperate from her ipod but still share the iTunes account?

    My daughter has an iPod touch using my apple ID, I just purchased an iPhone with the same ID. Is there a way to keep my stuff seperate from her ipod but still share the iTunes account? I was looking through the photo section on my iPhone and found pics my daughter has taken from her iPod. I do not want my pics, emails, etc to show up on her iPod. Is there a way to stop this from happening or do I have to create a different Apple ID for her to use instead?

    If you have iOS 8 on all devices then:
    If under 13 years create a new ID for her by:
    Family Sharing and Apple IDs for kids - Apple Support
    The use family sharing to share apps
    http://www.apple.com/ios/ios8/family-sharing/
    Family purchases and payments - Apple Support
    If underage and not i)S on all devices then you have to create an ID for here under your name and supervise it use:
    Create a NEW account using these instructions so yo do not have to use a credit card.
    Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before. Make sure you specify a birthdate that results in being at least 13 years old
      Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    More details of how:
    http://ipadhelp.com/ipad-help-tips-tricks/how-to-get-free-apps-from-the-app-stor e-without-a-credit-card/
    Use the new ID on her iPod but only for:
    Settings>Messages>Send and Receive
    Settings>FaceTime
    Settings>GameCenter
    and Settings>iCloud if you want her to have separate Contacts Calendar and some other things.   
    Continue to use the same/common Apple ID for Settings>iTunes and App stores so you can share purchases.

  • How do I stop Adobe Reader from crashing on my unprivileged user?

    I am running Windows 7 and I needed to create an unprivileged user on my computer. When I open a PDF file, it almost instantly crashes (I can view the document for about three seconds). If I simply open Adobe Reader without a PDF and click Edit -> Preferences, it crashes. If I open a PDF in any browser, it crashes.
    From what I have been able to surmise, it seems that Adobe Reader is trying to read the registry of my privileged user. I have tried uninstalling Adobe Reader, temporarily giving privileges to my unprivileged user, installing Adobe Reader on that user, and then remove the permissions, but the crash still occurs. The only way to stop Adobe Reader from crashing is to start the program as an administrator or change the account type to administrator. How do I stop Adobe Reader from crashing on my unprivileged user?

    It said "Adobe Reader has stopped working" soon after I opened it, but I was still able to scroll down the document. It was only once I pressed Close Program that it stopped working.
    Upon trying it a second time, it immediately stopped letting me scroll down when the program crashed. Here is the error log, I receive the exact same exception code every time:
    Application Error
    Faulting application name: AcroRd32.exe, version: 11.0.1.36, time stamp: 0x50d0b932
    Faulting module name: AcroRd32.exe, version: 11.0.1.36, time stamp: 0x50d0b932
    Exception code: 0x40000015
    Fault offset: 0x000b7e40
    Faulting process id: 0x104c
    Faulting application start time: 0x01ce02e04f2d96cc
    Faulting application path: C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe
    Faulting module path: C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe
    Report Id: 961d161d-6ed3-11e2-9fb2-001fbc09988e

  • There are songs on my icloud that I deleted from my itunes, but still show up on icloud. I want to delete them from icloud, but can't since they don't appear in my itunes!

    I have a large library on icloud- 26203 songs is the count when I'm playing over my apple TV, but my itunes only shows 25989 songs. There are songs on icloud that no longer are in my itunes library, or show up in itunes as being on icloud. I want to delete these songs but can't figure out how. I have reset my itunes match on both my computer and my apple tv to no avail.

    No. It's on and I update it daily.
    When I talk about removing songs from my shuffle play, I'm referring to listening over apple TV. My cloud limit is nearly maxed out, so I am constantly removing/adding songs. That's why I was surprised when I went to delete a song I no longer wanted in the mix and was surprised to find it already deleted from my itunes, but still present in the cloud. I've signed in and out of itunes/and match on apple tv as well, but that didn't remove the tunes in question!

  • I attempted to download X Yosemite to my Mac Pro. It timed out and would not finish. I cannot stop the website from believing it is still downloading. Help.

    I attempted to download X Yosemite to my Mac Pro.
    It timed out and would not finish.
    I cannot stop the website from believing it is still downloading.
    Help.

    oatgeo wrote:
    I  checked the proxy and it should be OK. That's mean I have to try and try again until I get it from the slow servers.
    Yes.

  • How do i stop using icloud on my ipod, but still using it on my iphone...

    How do i stop using icloud on my ipod, but still using it on my iphone?

    Welcome to the Apple Community.
    On your iPod, settings > iCloud, scroll down and delete the account.

  • I have removed the passcode from my ipad but still it is getting locked after sometime what can be reason for this?

    I have removed the passcode from my ipad but still it is getting locked after sometime what can be reason for this?

    Can you pls guide that when I am restoring my ipad from itunes do i need to restore as new or from backup?????
    Also is this problem  realted to using same apple id for two ipad..... Pls help and regarding ur suggesting of messing with my ipad , I will keep a check ..

  • Trying to read from a socket character by character

    Hi all,
    I have a problem with reading from a socket character by character. In the code shown below I try and read each character, and then write it to a file. The information sent to a socket sent from a file, and EOF is marked with character of ascii code 28 (file separator). However using BufferedReader.read() I get -1 forever. Is it reading only the last character to have been sent to the socket?
    As a side note, if I use readLine() (making sure the socket is sent a newline at end of msg) I can get the message fine. However, I want to be able to receive a message with 0 or many newlines in it (basically contents of a text file), so I want to avoid the readLine() method.
    Any help at all is appreciated,
    Colm
    CODE SNIPPET:
    try
    serverSocket = new ServerSocket(listenToPort);
    System.out.println("Server waiting for client on port " + serverSocket.getLocalPort());
    while(true)
    inSocket = serverSocket.accept();
    System.out.println("New connection accepted " + inSocket.getInetAddress() + ":" + inSocket.getPort());
    input = new BufferedReader(new InputStreamReader(inSocket.getInputStream()));
    fileOutput = new BufferedWriter(new FileWriter(outputFilename));
    System.out.println("Ready to write to file: " + outputFilename);
    //receive each character and output it to file until file separator arrives
    while(!eof)
    inCharBuf = input.read();
    System.out.print(inCharBuf);
    //check for file separator (ASCII code 28)
    if (inCharBuf == 28) eof = true;
    //inChar = (char) inCharBuf;
    fileOutput.write(inCharBuf);
    System.out.println("Finished writing to file: " + outputFilename);
    inSocket.close();
    catch (IOException e)
    System.out.println("IO Error with serverSocket: " + e);
    System.exit(-1);
    }(tabbing removed as it was messing up formatting)

    My guess is that the code that is writing to the
    socket did not flush it. You said in one case you
    could read it (via readln) if the writer was writing
    lines (writeln flushes, I believe). Are you writing
    the exact same data to the socket in both tests?woo hoo, I hadn't flushed the buffers alright!
    for anyone with similar problems, I was missing this from my write-to-socket method:
    output.flush();
    where output was the BufferedWriter I had created to write to the socket.
    Thanks a lot for pointing it out!
    Colm

  • How can I change the default pdf reader from the installed (but not yet registered) Adobe Acrobat 9 Pro to Adobe Reader XI?

    How can I change the default pdf reader from the installed (but not yet registered) Adobe Acrobat 9 Pro to Adobe Reader XI? I'm having some hiccups getting Adobe to register the software, but since I set it as the default .pdf reader during setup, things try (and fail) to open in the as yet unregistered software. How can I change it temporariiy to the Acrobat Reader XI that I have installed?

    Anubha,
    It worked! Thank you so much.
    I'd opened file with the 'Open with' feature then clicking Adobe Reader,
    but that didn't do it. When I used 'Open with', then 'Choose default
    program...', it worked like a charm.
    Again, thank you!
    Jonathan
    On Wed, Mar 18, 2015 at 10:16 PM, Anubha Goel <[email protected]>

  • TS1463 What is the easiest way to restore my ipod back to factory specs. It has a red circle with a red x in the middle,please help me to fix my ipod, until now i can't use my ipod..i tried all the procedures in Restore ipod from disk mode but still not w

    What is the easiest way to restore my ipod back to factory specs. It has a red circle with a red x in the middle,please help me to fix my ipod, until now i can't use my ipod..i tried all the procedures in Restore ipod from disk mode but still not working, please help me...

    If you are unable to get the iPod into Disk Mode to try and restore it, it's a very good indication, as mentioned in the article, that the iPod's hard drive is damaged and in need of replacement either by Apple or a third party repair company.
    B-rock

  • Downloaded pages from app store but still can's save documents.  Program says I need to purchase it still.

    Downloaded pages from app store but still can's save documents.  Program says I need to purchase it still.  What do I do?

    You need to totally delete the demo version first:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=105&mforum=iworktips ntrick
    Peter

  • Accidentally switched off iMac at mains. Now only goes to grey sceen when switched on. Have removed all USB's from ports and cable from screen rear but still grey screen. What next?

    Accidentally switched off iMac at mains. Now only goes to grey sceen when switched on. Have removed all USB's from ports and cable from screen rear but still grey screen. What next?

    I would reset the PRAM
    http://support.apple.com/kb/HT1379
    or
    I would try and reset the SMC
    http://support.apple.com/kb/ht3964

  • 4th Gen. ipod. No longer charges from wall socket. Still can charge from computer. Wall power adapter and cord both work fine on other devices. Wall Why?

    4th Generation ipod. Used to charge fine from wall socket (cord and USB adapter) and could also charge on the computer. Suddenly stopped charging from the wall. The same cord and adapter still work for my iphone, so there is not problem with either of them. What has changed? Why won't the ipod charge from the wall anymore? Is there anything I can do about it?

    Thanks! It didn't actually work with the one I was using to charge the computer either. We had tried the computer cable with the power adapter, and it didn't  work to charge the ipod, though it does charge my iphone. Following your idea further,  I waited for my husband to get home from a trip and tried one of his extra cables he keeps in his backpack. That cable worked in with the USB  power adaptor. I had thought that because the cable I use on my computer charges my iphone through the USB power adapter or the computer, and that it charged the ipod through the computer that it was fully functional. Apparantly not.  Thanks again.

  • Sockets: How do I know how much I can read from a socket?

    Hi everyone,
    I've opened a socket connection to a cisco router and want to read some of its databases. These are the main part of my code:
    Socket so = new Socket(routerIP, routerPort);
    BufferedReader br = new BufferedReader(
    new InputStreamReader(so.getInputStream()));
    BufferedWriter bw = new BufferedWriter(
    new OutputStreamWriter(so.getOutputStream()));
    // user/password entered.
    bw.write("show ip alias\r\n");
    bw.flush();
    while ((in = br.readLine()) != null) {
    System.out.println(in);
    so.close();
    The problem occurs in the "while" loop at the end of the code. The last line that the router is sending doesn't have a \r\n at the end and therefore my readLine command waits indefinitly.
    Well, I guess I can change that command with a simple read but still it won't be general. I'm looking for a command like "available" in socketImpl that tells me the number of bytes that I can read from the server beforehand.
    Any solutions?????????????
    Thanks,
    Ali.

    Ok, that much I know from the router. It supports
    telnet. So, basically if a telnet client can tell when
    it has read all the data coming from the router and
    when it has to wait for user to input the data, I have
    to be able to do so too.Hi, telnet does not know that it has read all the data coming from the router or from you; It waits for data from both sources (the router and you), and then retransmits that data to (you or the router respectively.)
    telnet must be sending and receiving data byte by byte
    cause what we type is displayed on the screen if the
    server echos the characters back to the client.
    Any suggestions, anyone knows of a simple telnet
    source?True. In particular, telnet does not care whether there is any carriage return or linefeed characters. It just retransmits whatever it gets from the source to the destination, except that it looks for particular escape sequences from the data source, such as the sequence for shutting out echo when you enter passwords.
    In your case, I am not sure what you want to achieve. I think you are trying to find the end-of-data but the end-of-data is not unambiguously terminated by an end-of-line. Maybe you need to find some other character or even strings for that purpose. You may even need to process the whole data received in order to determine the end of it.
    However, if you just want just that answer from the router and no more, you can send your logout after your query, so that after the router replies your queries, it also closes the connection and your BufferedReader.readLine() will return.

Maybe you are looking for

  • [SOLVED].xinitrc - some entries doesn't work

    Hey. There are problems with my .xinitrc. I tried to turn off the DPMS with it (configuring xorg.conf never changed the behaviour of dpms) by inserting the line "xset s off && xset -dpms". But it just doesn't do what I expecting from it, DPMS is stil

  • How to add a comment for each caption label present in a document?

    Hello everyone, I am trying to write a script to add comments for each caption label for figure and table. How can I select a caption and use Comments object for adding a comment? I tried using AutoCaptions list for going through all captions present

  • 1st event in report ?

    what is the 1st event  triggered in report ? top-of-page or strat-of selection ?

  • C310 Wont Power On.Dead) But Have Full Inks.Is There A Way To Manually Move The Ink Carrage

    Hello - I Have A Dead C310 All In One Printer- I Tried Hard Reset Numerious Times. I Have Full Ink Cartridages & Need To Manually The Cartradage Tray Manually, So I Can Put Them In Another Printer Which Uses The Same Ink 564 The Cartradages Cost Me X

  • Validators getting called multiple times?

    I am working on a project where were we have used BackingBean validators for an input text component. When I first submit, the validator method getting called once, when I submit again, its getting called twice, and it goes on. After clearing the ses