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