Turn off the power and wait for closing a connection

Hello

in a previous post, I ask for help with powerOff.

I see my app to enter in this method, but I have a problem:

I send a file to an FTP server using a class that I posted a few days ago.

The problem is when the user stop device when the ftp stor command is not finished.

I want to intercept and send abor command because without it, I find a file on the FTP server.

PowerOff() I change a Boolean value to tell the ftp process I ask for demolition, when see ftp, it stop the command stor and sends an abor command

The end of stor() method with a fake and I know the process to complete.

The problem is how can I wait for this false in the main screen.

I do something like

while (isFtpSending())
    try { wait() } catch (InterruptedException e){}

//isFtpSending is a synchronized method to change the value of boolean

I set up a model of the observer, when the FTP class to end the process it send an update of class from the main screen and I do

setFtpSending(false)
notify()

The problem is that when I do a wait(), it seems that off wire continues and stop the radio and all other process and stop device.

Any idea?

I think that what I need is a method to force the device to wait my thread.

I hope someone understands something, sorry for the bad English.

Thank you!

p.d. I change the class FTP, because all the stor method has been synchronized, so I can't change the Boolean askForAbort until there finishes. Now sending bytes code is out of sync.

Hello

I find a work around the use of powerOffRequestd (int reason) of SystemListener2

My end of thread before beginning the shutdown process.

I see that the problem is that some link narrow wire of bb without asking or wait...

I mark it as resolved

Tags: BlackBerry Developers

Similar Questions

  • The new App Store for El Capitan update has locked up my macbook pro.  Reboot got about 3/4 fact and the machine stops. Turned off the power and turn it on again for nothing doesn't.  How in my machine to begin troubleshooting?

    The new App Store for El Capitan update has locked up my macbook pro.  Reboot got about 3/4 fact and the machine stops. Turned off the power and turn it on again for nothing doesn't.  How in my machine to begin troubleshooting?

    The problem is most likely an attempt to update a system malfunction prior it is probably a problem with your computer, not the El Capitan.

    Start by:

    Reset the PRAM and NVRAM on your Mac.

    MacIntel: Reset of the controller (SMC) system management

    Start in Safe Mode , and then re - start normally. It's slower that a normal start, so be patient.

    If you are unable to start;

    Reinstall El Capitan without erasing the drive

    Please make sure that you back up.

    1. Restart the computer. Immediately after that the chime hold down the command and R until the Utility Menu appears.
    2. Select disk utility, then click on the continue button.
    3. Select the withdrawal (usually Macintosh HD) entry of the volume in the list aside.
    4. Click first aid icon in the toolbar. Wait until the button is active, then click it.
    5. Quit disk utility and re-enter the Utility Menu.
    6. Select Reinstall OS X and click on the continue button.

    Also, see this tip for user: basic steps for the OS X upgrade.

    If this doesn't get you;

    Install Yosemite or El Capitan, from scratch

    Backup if possible before proceeding.

    Restart the computer. Immediately after the chime hold down the command and R buttons until the Apple logo appears. When the Utility Menu appears:

    Select utility disc in the Menu Utility, then click the continue button.

    When loading disk utility, select the volume (entered into withdrawal, usually Macintosh HD) from the list of devices.

    Click Delete in the main window of disk utility. A panel will fall.

    Define the type of Format Mac OS extended (journaled).

    Click on the apply button, then wait for the done button to activate and click on it.

    Quit disk utility and re-enter the Utility Menu.

    Select reinstall OS X and click on the continue button.

  • When I start my computer, I connect by entering my password but the screen shows just the loading circle until I have turn off the power and turn the computer back on

    Original title: programs network networking Internet site Internet Site Web Web Site URL of the network

    Wen I turn on, I can point to enter my password. I entered my password and the screen displays a symbol of shooting and seems to expect something to go. The mouse does not work and none of the keys work. I have WIFI in my house, but the system looks like it's waiting to connect. I waited for more than 10 minutes. The only thing I can do is press and hold the switch down for a few seconds until there is a power down. I then power back up and get my password again. I between it and the system is in place OK. It happens all the time. It all started about 2 weeks ago. I have not loaded all the apps since it worked normally. Also, if I am growing up and running and I doi a stop with a reboot, the system comes down and restarts and arrives at the passwword. Enter the password and I have hung up again.

    Hi Greg,.

    ·         Have you checked the problem in safe mode?

    ·         What version of Windows operating system is installed on the computer?

    Try the following.

    Method 1: Start the computer in safe mode and see if the problem persists. Report of the results.

    Start your computer in safe mode

    Method 2: You can run the Microsoft Safety Scanner to search for infection by the virus. Check out the following link.

    Microsoft Safety Scanner - free online tool for PC health and safety

  • iPhone 4S heating quickly, turn off the power and the battery drains quickly.

    Hello

    My problem is exactly the same as the title. My iPhone 4S warms up quickly, turn it off and after I turn the iPhone, the battery drains quickly and the iPhone will turn off after 5 minutes. iPhone turns off again and again until I put the iPhone on the charger. It is bad because I like to play games like Pokémon GO. But after 10 minutes of play, the iPhone starts heating (and of course delay).

    Things I've tried: (and didn't work)

    The apps I use no fence. (I close applications once I stop playing)

    Turn off location Services. (Enabled only when I'm with apps like GPS...)

    Reduce the brightness

    I will be grateful for any kind of help.

    Welcome to Apple Support communities, Krystof11cze.

    It seems that you encounter problems with your iPhone 4S on iOS 9.2.1 with heating, battery draining and stopping. Good job on the steps you tried as I would have recommended those as well. I will do my best to help!

    1. backup of your iOS device - because I have erase you your iPhone completely, it is strongly recommended that you will lose your data if you do not.

    2. restore your device to factory settings - using the settings on your iPhone will only erase your personal data. You will need to let iTunes erase the iOS version installed a new clean copy can take place.

    3 test the question - the first time through, set up your iPhone as a new iPhone when it asks. It's just temporary. You can connect to iTunes and App Store and iCloud and also download some of your applications. Test for problems you encounter. If your iPhone's battery life is improved, follow the next step.

    4. restore your iPhone, iPad or iPod touch from a backup

    Take care!

  • Turn off the vibration and sound for notifications?

    Sound & Notification in a sliders to media parameters, alarm and ring volume, but no notifications. There is a switch to vibration for the call, but not turn it off for the vibrations.

    How do I turn down the volume on notifications and turn off vibrate?

    It is not related to Sony, it's Google work. But there were other threads on how to disable or enable the vibration to other than the default applications:

    https://talk.sonymobile.com/T5/Xperia-Z1-compact/issue-with-vibration-and-notification-per-app-since...

    You need to customize each app.

  • Disable the ability for applications prevent turn off the screen and start screen saver

    Hello

    I need to disable the ability of application full screen to turn off the screen and start screen saver. Basically just need to it:

    When there is no entry in the application that is running in full-screen, I want to turn on the screen saver and turn off the display. As far as I know, the windows default settings is to prevent turning on the screen saver during modes full screen.

    Thanks for the reply

    Hello

    Thanks for posting your query in Microsoft Community.

    According to the description, I understand that you have related questions screen saver settings in Windows.

    A screen saver is a program that, including the screen or filling it with moving images or patterns when the computer is not in use.

    Screensaver programs were designed to help avoid these effects by automatically changing the images on the screen during periods of user inactivity.

    Windows uses photos that better match your monitor for locking screen slide show.

    For more information: See photos on the desktop, start and the lock screen

    I hope this helps. Otherwise, feel free to write us again for more assistance, and we will be happy to help you come.

  • Cisco router WIFI does not work after turning off the power

    I have a CISCO router that worked very well until someone turned off the power for a few minutes.  I tried to unplug the modem, the router and the laptop and waited a bit.  Then I turned on the modem, then the router, then my laptop but it is still not in communication with the modem.  I can use the modem with a hard connection to the laptop but need the WiFi as well as others can use it.  Help, please.

    You need to contact support with your Cisco router.  It looks like it might have been reset and the installation needs again.

  • My MacBook Pro with El Capitan 10.6.11 close the menu drop down. I have to turn off the power

    The closing down and options no longer work in El Capitan 10.6.11 restart on my MacBook Pro mid-2012. I have to press the power button to turn off.  When shutting down or restarting are selected, the Ribbon at the top of the screen disappears and Finder is no longer available but other aps on the bench of the accused are still available. When I restart after turning off the power, the system is back to normal until I need to close again.

    Hello

    Just in case, run disk utility.

    Open utility disk located in Applications/Utilities

    Then select the disk to boot on the left and then select the first aid tab and then click run.

    If disk utility indicates that the disc seems to be OK, you are finished. Otherwise, you must repair the disk.

  • Should I turn off the keyboard and bluetooth mouse off?

    Hello

    I'm new to Apple products and have recently purchased an iMac with keyboard and mouse compatible bluetooth.  The are a switch on each accessory to activate the bluetooth on or off.  Should I turn off after closing down to save the battery power or not this wear simply on the switches.  Not sure if stop actually stops transmitting wireless accessories, or if the latter uses the negligible power when the computer is turned off.

    Thank you

    JosfromSydney

    JosfromSydney wrote:

    Hello

    I'm new to Apple products and have recently purchased an iMac with keyboard and mouse compatible bluetooth.  The are a switch on each accessory to activate the bluetooth on or off.  Should I turn off after closing down to save the battery power or not this wear simply on the switches.  Not sure if stop actually stops transmitting wireless accessories, or if the latter uses the negligible power when the computer is turned off.

    Thank you

    JosfromSydney

    Yes switches turn off the wireless, and yes they use negligible power when the computer is turned off.

  • Satellite L20: Can I disconnect devices such as USB mouse without turning off the power?

    Hi all.
    I am owner of laptop Satellite L20. I always turned off power to my computer when I need to connect or disconnect a USB device. Some devices have a special icon on the toolbar disconnect them, but some don't (FDD USB or flash drives). Can I disconnect and connect devices such as mouse USB or Scanner wihtout turning off the power?

    Hello

    You can disconnect the external USB devices without turning off the unit, but you must use the option "remove hardware" before you cut the material.
    The icon "Remove hardware" usually appears with resources such as hard drives or USB key have the ability to buffer data. It of necessary for this buffer to the device before emptying it is disconnected

  • LJ Pro300 color MFP M375nw. Power cycling, displays "49 service error - turn off the power, then press" on-screen.

    Bike constantly, the power display "49 service error - turn off the power, then press ' on-screen before stopping.
    For this printer only when it is connected to the network. Quite happy to sit quietly when printer NOT connected to the network.

    Unplug the network cable from the printer, check and clear all print queues (there may be a doc pdf sitting in a pc or server print queue)

    Once the queues have been dotted, restart the printer and reconnect the network cable.

    If this does not cure the problem, then the likely problem is a defective formatter Board.

    Good luck!

  • After the update to el Capitan my iMac will not be asleep. I put it to sleep and turn off the mouse and keyboard that goes with it, and 5-10 minutes later, he wakes up on his own. Now, I have to stop it after use and each time only. Major pain

    After the update to el Capitan my iMac will not be asleep. I put it to sleep and turn off the mouse and keyboard that goes with it, and 5-10 minutes later, he wakes up on his own. Now, I have to stop it after use and each time only. The Major pain. Any help would be greatly appreciated.

    Please test after taking each of the steps that you have already tried:

    Step 1

    Take all of the measures suggested in this support article, including those under the title "If the previous steps do not work." It is the starting point for a new effort to solve the problem.

    Note that, as stated in the article, the computer will not sleep, if some sharing services are enabled. In the menu bar, select

     ▹ System Preferences... ▹ Sharing

    Disable all sharing services.

    Step 2

    If sharing music iTunes home sharing is enabled, disable it or quit iTunes. Do the same with third-party applications that have a similar feature.

    Step 3

    Select

     ▹ System Preferences... ▹ Accessibility ▹ Speakable Items: Off

    Step 4

    Select

     ▹ System Preferences... ▹ ▹ Advanced Bluetooth...

    and uncheck the two boxes marked

    Open Bluetooth Setup Assistant at startup if...

    Step 5

    Reset the printing system.

    Step 6

    Back up all data.

    Triple-click on the line below on this page to select, then copy the text to the Clipboard by pressing Control-C key combination:

    /var/vm

    In the Finder, select

    Go ▹ go to the folder...

    from the menu bar and paste it into the box that opens by pressing command + V. You won't see what you pasted a newline being included. Press return.

    A folder named 'vm' should open. Inside, there may be a file named 'drag '. Move this file and only this one in the trash, but do not yet empty. You will be asked for your password. Close the folder window.

    Restart the computer and empty the trash.

  • When my battery is fully charged, what button I press to turn off the battery and use the DC

    When my battery is fully charged, what button I press to turn off the battery and use the DC. I need to know what to do to avoid the impoverishment of my battery. OR is it save to leave the computer on, even when the battery is fully charged

    Well, actually from what I read, it's correct exactly as it goes, but not a complete list of the maintenance of the batteries all the factors, methods, practices and details regarding the definition of periodicals.

    While he was just more info not really part of what has been requested, this is why I don't give him properly a collection, I appreciate that you expand on it with greater precision.

    It is not often that one of my messages is considered as not long enough.  :-)

    Thanks for the help.

  • All lights on screen Flash - Message - Please turn off the printer and turn it back on

    I'm fighting a problem for a few weeks now with all the lights on the display starts flashing and the message please turn off the printer and turn it back on.   HP sent me a new printer that does the same thing.  The printer is an Officejet Pro 8600.  My computer is Windows 7.  I use a Belkin 750 db wireless router.  I talked to the service the customer several times with no results.  Did a hard reset of the printer, change the SSID of the router, because I think that one of my neighbors has the same router.  The thing most effective I did was change the channel to 6 which will operate for several hours until the display starts to Flash again.  Channels 1 & 11 starts blinking after a few minutes.  I know there are other people who have had the same problem.  I'm about to throw the thing in the trash.  My last printer brand X was set up the same way with no problems.  On the network, there are 2 iPads, smart TV, and an iPhone.  Need help please!

    Super Dave

    Ethernet cable and connection with correction of the problem.  Its been 2 days and the printer worked perfectly.  Please pass this solution on your technical telephone support staff because I know that there are others with the same question.  Thanks for your help.

  • I bought Adobe Acrobat DC. We use it in a desktop environment. Is there a way to "TURN OFF" the concept of cloud for another user does not see a confidential pdf in their queue?

    Is there a way to "TURN OFF" the concept of cloud for another user does not see a confidential pdf in their queue?

    I tried to contact technical support to the 800-833-6687 but was put through several automatic guests and disconnected.

    Hi plumasca,

    Refer to this topic for help disable features/services online in Acrobat/Reader DC?

    Kind regards
    Nicos

Maybe you are looking for

  • Satellite T110-107 - Reboot does not work properly

    When the power button is pushed to the power and wireless lights, fan whirs a minute then nothing more happens. If I remove the battery and leave it for 30 minutes then it starts fine when you push the power button. Currently abroad, but have access

  • Satellite A200-1AG - Drivers not found

    I install a new SO on my Satellite A200-1AG, MODEL No. PSAECE-01100KSP,.and there are some haven´t drivers been installed correctly. They are: Controladora bus SMPCI\VEN_8086 & DEV_27DA & SUBSYS_FF001179 & REV_02\3 & B1B FB68 & 0 & FBUnknown deviceAC

  • Equium A200: How to remove a partition without losing the BONE

    I have a laptop of A200 equium with a 120 GB hard drive but it is partitioned.Can you remove a partition on a hard disk without losing the operating system and get a hard drive with 120 GB? If so can you tell me how.

  • How can I back up my Vista on Satellite A215?

    I just bought a Satellite A215 and I wanted Vista preinstalled on a backup DVD. I know that laptop manufacturers notebok comes with a separate partition for Vista and its drivers that you can easily write on the DVD. Is this a directory I can copy th

  • Pavilion dv7-3135eo: password administrator or power on password

    Hello I get this message when start upward, and can remember the password. When I click ENTER 3 times, I get this code: 55034370 Can you help me with the code to open it? I'm gonne difficulty this laptop for a friend and he cannot remember this passw