How to interrupt without closing

I have a socket, (and optionally a SocketChannel) and I have another thread that is taking the block.
I need to make the other thread finish its execution of the read() method once, (and thus causing it to check a few modified fields), without closing the socket, (like interrupt() does).
The solution needs to not harm the connection in any way (like shutdownInput()) and not stop the thread (like stop()).
Any help would be appreciated, thanks.

You can't implement this in Java as stated. Platform considerations dictated that interrupting a read closes the socket. (I believe this was forced on Sun by Linux.). You will have to use a very short timeout on the read and have the reading thread effectively 'poll' for socket input and/or object changes.
EJP

Similar Messages

  • How do I close all tabs at one time without closing Firefox completely?

    How do I close all tabs at one time without closing Firefox completely?

    Open a new window. Go to the other window with all the tab. Close it. You now only have that newly open window.
    Hub

  • How to see inbox/ other mail without closing the e-mail I'm writing?

    New Mac user seeks help!
    If I'm writing an e-mail, I don't seem to be able to switch to my in-box without closing and saving the e-mail first (it's like having an open dialogue box in windows, where you can see but not access the program underneath until you close the box).  Can I not have multiple e-mails open at the same time?  Or look at my in-box or sent mail while I write?  I didn't realize how often I need to check a previous message while writing the current one until now, when I can't do it except laboriously!
    Any suggestions would be much appreciated.

    Thanks!!  Trying to implement your solution made me realize what my problem was. My default mail setting seemed to be full screen, and in full screen mode I can't access the inbox or buttons underneath the open e-mail. But as soon as I shrink the e-mail slightly in order to see the top menu bar, it allowed me to not only access the menu bar, but also brought the whole inbox and associated tools alive.
    With a little playing, I figured out to bring to the foreground function, as well as various ways to see multiple e-mails side-by-side, or switch between them from both the Window menu, as well as from the dock.
    Many thanks for your help! While so far I have successfully googled all the things I couldn't figure out how to do, I didn't seem to be able to create search terms that were giving me a meaningful answer to this particular question.
    It's a big learning curve, but oh so worth it!

  • How do I close a numbers document without closing the entire app?

    Can anyone tell me how I can close a numbers document without closing the entire app? i.e. go back to the folders display page - is this even possible?

    It is not a bug, but a new feature.<br />
    Some menu entries in the main menu bar are hidden if you use the mouse and only appear if you use the keyboard to open the menu (Bug 626825).
    You can see the difference if you use Alt+F to open the File menu or other menus like the Edit menu (Alt+E) and Bookmarks menu (Alt+B) and compare that to what you see if you use the mouse to open the menu after you have made the menu bar visible by tapping Alt or by pressing F10.
    *[https://bugzilla.mozilla.org/show_bug.cgi?id=626825 bug 626825] - Hide redundant menu commands unless the user invokes the menu using the keyboard (make use of the openedWithKey attribute)
    ''(please do not comment in bug reports; you can vote instead)''
    See also:
    * [[/questions/799856#answer-155765]]

  • How can I have one thing open in Safari on my MacBook Pro and search for another thing in Safari without closing out of the other? For instance, How can I leave Pandora playing while I search Facebook?

    How can I have one thing open in Safari on my MacBook Pro and search for another thing in Safari without closing out of the other? For instance, How can I leave Pandora playing while I search Facebook?

    With Safari open use the Command + T keyboard shortcut to open a new tab.
    Or, Command + N to open a new window.

  • How can I close a category in the form central form without closing it as error?

    How can I close a category in the form central form without closing it as error?

    I'm still not sure I follow - let me see if this is right.  You want to have users signing up for something using a FormsCentral form and then when something is full you'd like that section to show as "Closed" or full so nobody else can sign up for that particular event/day/time?  If that is the goal FormsCentral does not have any logic to close certain portions of the form.
    Thanks,
    Josh

  • My cursor has frozen on a word document - how can I unfreeze it without closing or force quitting Word?

    My cursor has frozen on a word document - how can I unfreeze it without closing or force quitting Word? I am a writer and have multiple documents going at any one time - I think this may be partly the cause for the freeze.  I would rather not force quit because there are too many documents that may have been added to that weren't saved. Im not so keen on the auto recovery process  Please help!!  Aussie  OSX 10.8.5  2.2 GHz   Intel Core i7 Memory  4GB 1333 MHz DDR3.

    If you click outside a Word document, is the cursor movement normal? And if you select Force Quit does the tag next to Word say "Not Responding"?
    I'm afraid that the only way to get out of your predicament is to Force Quit Word. If you had auto-save on, you may or may not be able to recover some of your documents. I sometimes have up to 12 Word documents or so loaded at one time, so your problem shouldn't be put down to you having multiple documents open.
    Sorry that I couldn't really help - I just don't see any way of getting out of your predicament. You MAY want to try pressing the command and period keys at the same time, but I really don't think that will stop anything.
    Clinton

  • How do I stop an infinite loop because of a poorly placed user prompt during developmen​t without closing LabView?

    How do I stop an infinite loop because of a poorly placed user prompt during development without closing LabView?
    Thank you!
    Solved!
    Go to Solution.

    chuck72352 wrote:
    Here is an example of a VI that I can't stop.
    Epic Fail
    but seriously, as was suggested, download Darren's Abort.vi. It comes in very handy for these.
    Message Edited by Broken Arrow on 05-03-2010 01:06 PM
    Richard

  • How do get rid of a tab group without closing the tabs? How do I take tabs out of a group?

    I accidentally put all my tabs in one group. I'd like to get rid of the group without closing all the tabs in it; in other words, to undo putting all the tabs in one group. It would be useful to know how to remove a tab from a group without closing the tab, accidentally putting a tab in the wrong group will probably be a common error that needs to be easily undone.

    '' SisqB;''
    ''I searched about:config and found a listing of "stuff" under the S3 Downloads ''
    Can you take a snapshot of what you see?
    In order to better assist you with your issue please provide us with a screenshot. If you need help to create a screenshot, please see [[How do I create a screenshot of my problem?]]
    Once you've done this, attach the saved screenshot file to your forum post by clicking the '''Browse...''' button below the ''Post your reply'' box. This will help us to visualize the problem.
    Thank you!

  • How to close locked tab without closing firefox

    When firefox freezes how do I close offending tab without closing firefox

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    If it works in Safe Mode and in normal mode with all extensions (Tools > Add-ons > Extensions) disabled then try to find which extension is causing it by enabling one extension at a time until the problem reappears.
    Close and restart Firefox after each change via "Firefox > Exit" (Windows: Firefox/File > Exit; Mac: Firefox > Quit Firefox; Linux: Firefox/File > Quit)
    *If you have many extensions then first enable half of the extensions to test which half has the problem.
    *Continue to divide the bad half that still has the issue until you find which one is causing it.

  • New Lion......how to open other Safari windows when one is open without closing Safari and starting again?

    New Lion. How to open other Safari screens without closing Safari and starting again?

    Safari
    Apple Support Safari
    Lion Mac OS X Communities
    Apple Support Lion

  • How do I selectivly close the only not responding window (without closing the other 3 responding windows)

    Presently, I have 4 windows opened, each with a bunch of tabs.
    Since I restarted firefox this morning, one out these 4 windows, keeps on not displaying.
    How do I selectivly close this only window (without closing the 3 others windows)

    Here is what the manpage shows:
    [ps(1)|http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/p s.1.html]
    state The state is given by a sequence of letters, for example, ``RWNA''. The first letter indicates the run
    state of the process:
    I Marks a process that is idle (sleeping for longer than about 20 seconds).
    R Marks a runnable process.
    S Marks a process that is sleeping for less than about 20 seconds.
    T Marks a stopped process.
    U Marks a process in uninterruptible wait.
    Z Marks a dead process (a ``zombie'').
    Additional characters after these, if any, indicate additional state information:
    + The process is in the foreground process group of its control terminal.
    < The process has raised CPU scheduling priority.
    <div class="jive-quote"> The process has specified a soft limit on memory requirements and is currently exceeding that
    limit; such a process is (necessarily) not swapped.
    A the process has asked for random page replacement (VA_ANOM, from vadvise(2), for example,
    lisp(1) in a garbage collect).
    E The process is trying to exit.
    L The process has pages locked in core (for example, for raw I/O).
    N The process has reduced CPU scheduling priority (see setpriority(2)).
    S The process has asked for FIFO page replacement (VA_SEQL, from vadvise(2), for example, a large
    image processing program using virtual memory to sequentially address voluminous data).
    s The process is a session leader.
    V The process is suspended during a vfork.
    W The process is swapped out.
    X The process is being traced or debugged.

  • Whenever I open a post on Facebook I can't close it without closing also the site. How can I change that ?, Whenever I open a post on Facebook I can't close it without closing also the site. How can I change that ?

    Since I got OS X Mavericks whenever I open a post on Facebook I can't close it without having to close the whole site also. How can I change that ?, Whenever I open a post on Facebook I can't close it without closing also the site. How can I change that ? Thanks.

    What does FaceBook have to say about that?
    Repeating yourself four times was such a great help, not.

  • How to close video window without closing iTunes?

    I usually watch video podcasts on iTunes rather than on my iPod. But when the video finishes, how do I close that window without closing iTunes?

    Oops. I just discovered the little white circle with the x in it, that appears in the upper right corner of the video window when the cursor is moved inside the window.

  • How to open a folder inside a folder, without closing the first?

    I can't find a way to open a sub-folder, inside a mainfolder, without closing the main folder.
    What's even worse, if you hold "option" or "command,"  (old OS9 muscle memory kicking in) it opens the new folder but wipes-out the ability to use the back button!  So then if you needed that main folder open, and it's deep inside some chain, you have to go searching for it again.
    So, is there any fix for this?
    <Edited by Host>

    Problems such as yours are sometimes caused by files that should belong to you but are locked or have wrong permissions. This procedure will check for such files. It makes no changes and therefore will not, in itself, solve your problem.
    First, empty the Trash, if possible.
    Triple-click anywhere in the line below on this page to select it, then copy the selected text to the Clipboard by pressing the key combination command-C:
    find ~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 -o -acl \) 2> /dev/null | wc -l
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). The command may take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear.
    The output of this command, on a line directly below what you entered, will be a number such as "41." Please post it in a reply.

Maybe you are looking for

  • Problems with installation J2SDK on a GLIB 2.2.4

    Hi, everyone say that Microsoft's products have a lot of bugs,.... but I�m trying (and tired) to install J2SDK 1.4.0_01 and the installer showed me repetitively the error "glibc >= 2.1.2-11" is need to j2sdk-1.4.0_01.fcs. So what was the problem ? My

  • After I upgraded to iOS 5, my Genius icon/button disappeared. How do I get it back on my iPhone?

    After I upgraded to iOS 5, my Genius icon/button disappeared when using my music player on my iPhone. I am not using iTunes Match, just ensured it's disabled. How do I get my Genius icon/button back on my iPhone? Genius is enabled in iTunes, using th

  • The resource manager is doing work outside a global transaction

    I use Orable 8.1.7.4 with Sun Java Application Server 7.0.0_04. The XA data source I use is oracle.jdbc.xa.client.OracleXADataSource. Oracle JDBC driver version is 10.1.0.2.0. I have an J2EE application with 2 EJB modules. Each EJB module works use o

  • Pages Panel Empty

    I am using Indesign CS5.5 and my pages panel is completely empty. Can someone help me get it functioning again?

  • Partition By Function creating problem in Disco 10g

    We have used "Partition By" analytical function in some of our reports. We were running it in Disco 4i without any problem. But when we tried to run those reports in disco 10g, all the calculation columns where "Partition By" function is used, showin