Close the Socket in Finally branch : Socket : Network Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Network » Socket »

 

Close the Socket in Finally branch


 

package
{
    import flash.display.Sprite;
    import flash.errors.IOError;
    import flash.net.Socket;

    public class Main extends Sprite

    {
        public function Main()
        {
            try
            {
                var s:Socket = new Socket();
                s.connect("http://www.cmu.edu/"80);
            catch(error:IOError) {
                trace("I/O Error:", error.message);
            catch(error:SecurityError) {
                trace("Security Error:", error.message);
            finally {
                s.close();
            }
        }
    }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Network
» Socket


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0