Continuous listener

after started a thread, I want to make that thread continuously listening for incoming messages. Normally, I use a while loop but it keeps locking up the machine. Is there a special type of "event" class for this purpose without locking up the system?

If you are using blocking I/O, the read method blocks until data is available.
If you are using non-blocking I/O you should block via a Selector until data is available.
If you are looping until InputStream.available() > 0 or Reader.ready(), don't. Just do the read.

Similar Messages

  • How can I continue listening to a YouTube video while using another app?

    How can I continue listening to a YouTube video while using another app?

    How can I continue listening to a YouTube video while using another app?

  • Continue listen for sms

    hi all
    my mobile phone is connect to PC via usb and i m using SMSlib API to send and receive message
    i want my programm will continu listen comm port when new message arrive it will pick this and take appropiat action and send result back from where message arrive
    is there any procedure in java that it will sence any new sms
    thanks in advance
    shahzad

    Hey Shahzad
    Which mobile phone model are you using?
    Rgds
    Nandan Pujar

  • Radio: "Please log in to continue listening..." But how?

    Hi all,
    I tried to activate a radio station on iTunes (specifically, the 'Seasons and Celebrations' station under 'Eclectic'), but when I clicked on the link I heard a 'bing', then a voice said, "65. Please log in with your Live365 account to continue listening..."
    Does anyone know how one 'logs in' to a iTunes stream? I can't find any way to do it. I registered with Live365.com and am logged in on the Internet, but there aren't any instructions on how to get iTunes to play the station. It just keeps asking me to log in.
    Thanks for any help!

    Does this help?
    http://www.live365.com/help/listen/mac/itunes.html

  • 6133b: Is it possible to continue listening to mus...

    Please tell me how can I do that? If thats not possible then can the display be truned off as it remains on all the time while listening to music files

    Just figured out that the way to continue listening to music and have the fold closed is to use Music Player instead if clicking on a music file to play it.

  • How can close the lid to my macbook air and continue listening to my music?

    How can I close the lid to my Macbook Air and continue listening to my music? When the lid is closed the music stops playing.

    The computer will immediately go to sleep when the lid is closed unless there is an external display attached to the computer. This is a feature that is not user configurable.

  • The 'now playing' feature has gone from my music app on the iphone 6 after the ios 8.3 update. When i go to continue listening to music after a break it does not allow me to continue where i left of as the 'now playing' feature has gone

    I have an iphone 6 ios 8.3, the 'now playing' function seems to have disappeared from my music app so if I listen to an album halfway through then take a break when I go back later the 'now playing' feature is not there and it returns me to the artist page. Can anyone help? its the first time I've had this issue.   

    That is correct.
    That is the price of a replacement iphone once your iphone is outside of the warranty period

  • I can't continue listening to the song I had paused

    I have a playlist in my music on shuffle and when I put the current song on pause and come back to it later I can't continue the songs from where I left off. I used to slide up the control center and just press play to continue the song I was on, but that won't work anymore.

    Hi karina214,
    Welcome to the Support Communities!
    Does this behaviour happen with any song, or only a specific song?  I would suggest resetting the iPod shuffle to resolve the issue. 
    Resetting iPod shuffle
    http://support.apple.com/kb/HT1655
    Cheers,
    - Judy

  • Trouble with continuous listening to songs

    I just updated my sportify app on my sony xperia z2, but for some reason, my music won't go to the next song when the song i started with ended. This happens only (I think) with songs that aren't from spotify. If i want to go to the next song i have to do it manualy, but thats kinda annoying. I tried restarting my phone but that didnt work. I have no clue what the cause is of this problem, but before the update i had no problems with the app.
    sorry for my bad english writing, but i hope you understand my problem :P

    rgg wrote:
    I'm also seeing this since the update to v2.2.0.636. Playing any downloaded local song works fine but playback stops at the end of the song. The controls show that Spotify is still playing, rather than stopped or paused. Skipping forward works correctly. This does not happen with songs downloaded from Spotify.
    I'm on an HTC M8, unlocked European version, running Lollipop 5.0.1. I haven't tried a clean install because quite frankly I'm fed up being told to delete and reinstall hundreds on songs each time a new bug is introduced.
    rgg wrote:
    I'm also seeing this since the update to v2.2.0.636. Playing any downloaded local song works fine but playback stops at the end of the song. The controls show that Spotify is still playing, rather than stopped or paused. Skipping forward works correctly. This does not happen with songs downloaded from Spotify.
    I'm on an HTC M8, unlocked European version, running Lollipop 5.0.1. I haven't tried a clean install because quite frankly I'm fed up being told to delete and reinstall hundreds on songs each time a new bug is introduced.
    Hi there. I'm running the same device as you... Think this thread may help you: https://community.spotify.com/t5/Help-Android/PLEASE-READ-Android-5-x-Lollipop-Distorted-playback-sound-levels/td-p/1028205

  • Resume listening to itunes radio

    Has anyone else had the issue where iTunes Radio will stop playing after a couple of hours and ask "resume listening to itunes radio?" and make you click a button to continue?  As soon as I click it, it resumes.  This is pretty annoying since I run it from a headless Mini and have to log into it every time I want to continue listening.

    Yep, it's pretty common. Sometimes it will allow you to continue, and sometimes you have to select a different station, or log out of your iTunes Store account and back in, to continue. iTunes Radio is clearly not a finished product and these problems are a big reason why I haven't dropped my subscriptions to Spotify and Pandora yet.
    Regards.

  • ITunes and continuity

    Is there any way to continue listening to itunes from my iphone in the car and then have the same playlist continue playing through my imac when I enter my house through my various airplay enabled speakers through out the  house, I am able to do this with Spotify but it seems that I have to stop iTunes on my iphone and find the playlist on my itunes, then find the place where I stopped listening on iTunes Match,  and then enable the remote on my iphone to play throughout the house.  A bit long winde

    I have to whole heartedly agree with the closing comment- nice job apple.
    Like the OP I was somewhat doubtful about going the Yosemite route especially given that meant bringing a MID 2011 iMac, late 2012 MBP (non retina) and an ageing IPAD 2 up to date with Yosemite and IOS 8.1.
    How did it go? Flawlessly!
    Do all my devices look better and work better than before? Yes!
    Did I have any panic attacks while doing it? No!
    Did it cost me a penny? No!
    Did I have to have a degree in IT to do it or make it work after? No in fact I just hit upgrade and that was it!
    Did everything work after including Time machine, iDrive and Bootcamp? Yep without a hitch!
    Where else does a global brand like apple give you something for nothing that is a genuine enhancement and improves your productivity? Nowhere!
    You get what you pay for in the first place with Apple, those of you who want to build a PC from bits in your bedroom and then spend the rest of your life tweaking it (making it work properly) carry on, I have more important things to do like earning a living and spending time with my kids!

  • When I turn on the jot touch in my art apps the music I'm listening in iTunes on my ipad stops

    I can continue listening to music when Procreate hasn't recognized the Jot is connected but once I close and restart the app (and the notification that the Jot is connected) to get the pressure sensitivity back - the music stops. I even uninstalled the app and reinstalled it. I started up the music - opened the app and the music was still running - but once I opened the settings in Procreate and clicked to turn on the external devices the music stopped.
    I also noticed that in the music player on the iPad, in the upper right hand corner, there was a drop-down button that wasn't there before that reads "airplay". Beneath it lists "iPad" and "Bluetooth Adonit Jot".
    It might not be a problem with the Jot at all and perhaps the iOS or Procreate is at fault.
    Just wanted to give a few more details to help you troubleshoot. I love the Jot, I love Procreate and I love my iPad... it just ***** that I can't enjoy all 3 with some tunes.
    Sorry, forgot to mention that it isn't just with Procreate but also with Artrage and Sketchbook Pro. So it may be an Apple or Adonit thing.

    Try logging out of your account on the iPad by tapping on your id in Settings > Store and then log back in and see if it then works.
    If that doesn't solve it then what has worked for some people is going into Settings > General > Date & Time and change the date to a few months in the future and then re-trying

  • Is there a way to play two radios at once?

    I usually listen to music using the Songza, Pandora, or iHeart Radio app. Recently I started listening to a news talk radio through the iHeart Radio app. I want to continue listening to the news talk shows, but I'd like to listen to music in the background. Is it at all possible to have two radio apps playing at the same time?

    Another option is to make a smart album with the criteria: Album is XXXX and Album is YYYY. Rather awkward but would work.
    OT

  • Native Music Application Stuck on Skip

    I looked for a better location to start this discussion, but I can't seem to find a place already started to discuss the native music app that comes with the iPhone.
    While there are applications listed such as iTunes U, iBooks, iPhoto, etc under iOS apps, the music app is not there.
    Moving on to my predicament:
    When the new ios7 came out, one feature I was excited to start playing with was the new iTunes Radio. At first it worked, I added a chanel, listened to it, thumbed up a couple songs, etc.
    The next day I go to continue listening to my added channel. It will not play. Instead, it scrolls through (right to left) song name after song name, not stoping no matter what I press. I tried restarting app and phone alike. This was the first day...I gave up and tried a day later. Now it scrolls through and stops after 6 songs (as though I myself were skipping the songs and it had reached its limit.
    It does this every time I add a station, and if I play a station without adding it, it plays the first song and then skips by 6 song titles incredibly fast.
    I wanted to bring this up here in case it was happening to anyone else.
    Thanks for reading, and thanks in advance for any recomendations and/or feedback.

    Thank you Rod for the clarification.
    As an added note. I finally got a response from Oracle Support regarding my question and posted below:
    "Yes. You can skip to section 7 not step 7
    Correct one is section 7. as in Note - 417558.1 (but internal note,not published)
    It should be
    If you have only migrated your existing 4i End User Layers to Discoverer 10.1.2
    without patching new eex files, you can skip the remaining steps in this
    section and proceed with Section 7 ( as in Note - 417558.1 )
    There was a remark on the Note 313418.1 to change this.

  • Podcast Jumping - but only on iPhones/iPods

    Ok, so I have an odd problem with my podcast. (One I produce, not one I listen to.)
    My podcast will literally stop in the middle, and jump to another episode. If you go back, it will resume the show, but then it will jump again just a few minutes later. This has not been a problem for those listening on Stitcher, and it is not a problem for those listening directly from iTunes or from Podbean on their computers - it only seems to be happening on mobiles via downloads through iTunes and then loaded onto the phone.
    My listeners, luckily, perservere and continue listening anyway (at least the ones that have told me about it), but I am afraid I am losing listeners, or will lose listeners, because of this problem.
    Does anyone have any idea what might be going on?
    I had ONE episode that worked without flaws for everyone, and on that episode I did the following - I edit in Audacity:
    1. Record in Skype with Pamela as a .mp3
    2. Truncate silence
    3. Equalize
    4. Compressor
    5. Add intro and outtro
    6. Export as mp3
    I read, during the week, that one shouldn't ever really edit an mp3, and that one should instead record as a .wav, and then convert to .mp3, so that was the one difference I made on this last episode:
    1. Record in Skype with Pamela as .wav
    2. Truncate silence
    3. Equalize
    4. Compressor
    5. Add intro and outtro
    6. Export as mp3
    I would think that recording it in a wav and then changing it to mp3 was the problem, except all of the previous episodes that had problems were not recorded that way. I had thought, before the episode that worked, that I was over-editing. I was doing MUCH more than those six steps in an attempt to make it sound good before then. When episode 10 worked without flaws, I was ecstatic! And I am now frustrated again with the problems with Episode 11 - a repeat despite not over-editing.
    (Details were added for those who might need to know what I'm doing in order to see what's going wrong.)
    Any help I can receive would be greatly appreciated. I'm fairly new to podcasting, and I am still working out the kinks. :-( I want it to be a flawless thing for my listeners, but when they listen on their iPhones or iPods via their downloads from the iTunes store, it has only lead to frustration.
    Thank you in advance,
    Sarah

    Your Store page is at http://itunes.apple.com/gb/podcast/oh-my-goodness-not-another/id511797943
    Your feed is at http://omgnap.podbean.com/feed/
    The media file for episode 11 is at http://omgnap.podbean.com/mf/feed/qtppf8/OMGNAPEpisode11.mp3
    Two possible issues occur to me. Firstly, since the iPhone requires the server hosting the media file to handle 'byte-range requests' (i.e. requesting only part of a file at a time, not the whole thing) this could be an issue. Many servers don't handle this and it's been causing complaints from iPhone users to the point where Apple have now made it a requirement for new podcasts. Yours has I think been running for long enough not to have fallen over that, but it would be worth asking Podbean whether they can handle this. If they can't, that could be your problem.
    The other problem may be server delivery speed. I was able to play the podcast directly from the Store - I spot checked it without problems; but when subscribing one has to download the entire file. I was told by iTunes this would take around 20 minutes. Trying to download directly in Safari produced a similar download speed - in fact a download time of 35 minutes. (I've not downloaded the entire episode.)
    The file is 110MB; my internet connection is theoretically capable of downloading it in 15 seconds (not that I would expect to reach that) but 20 to 35 minutes is really very slow. It's faster than real time, so in theory there shouldn't be a problem about running out of buffer space, but even so it's not going to help.
    I don't think the different editing methods you've used are anything to do with it. The reason for not editing an MP3 is audio quality degradation through re-compressing, not anything to do with the integrity of the file.
    Your first step is to chase up the byte-range request matter with Podbean.

Maybe you are looking for

  • Using the 3 D function the CS 6 operation hangs then closes and restarting CS 6 is required.

    I have tried using the 3D function with some fancy fonts and most of the time all works very well. I noticed the extrusion with Twist and Taper is a bit sensitive and has a quick move to a range that hangs my PC. It has happend a couple of times but

  • How do you identify mail in the junk folder as "not junk"?

    I came across this answer on the Apple support site: Tell Mail that a message is legitimate by marking it as not junk. Click Not Junk in the banner of the message; or select the message, then click the Not Junk button in the Mail toolbar. Unfortunate

  • External Monitor with XP using closed lid on laptop

    Is there a way to turn the laptop screen off and use an external monitor when running Boot Camp and XP pro. I have bluetooth keyboard & usb mouse. Display is cloned but when you close the lid the screen stays on.Some forums indicates its OK for the s

  • Itunes wont open says this:

    All of a sudden when i try to open itunes with or without my ipod in it says this "You cannot open the application "itunes" because another user has it open. Ask the other user to quit the application then try again". And no one else in my house has

  • Any Sql Solution for this?

    Hi guys, How can I update rows which total upto the number of dollars the user enters. Ex: I have the following rows in the table Col1 Col2 Col3 Col4 1------10------A 2-------3------B 3-------7------C 4------20------D 5-------5------E 6-------5------