Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in AS3 Example : SocketError #1023 when optional arguments to connect() not set #12

Open
GoogleCodeExporter opened this issue Dec 2, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

There is a bug in the AS3 example.

The following will not work:


var s:SerialPort = new SerialPort("127.0.0.1", 5334);
s.connect();

This will causes a Flash Socket error #1023

If you look at the connect function:

        public function connect( host:String = null, port:int = 0 ):void
        {           
            _socket.connect( host, port );
            trace( "connecting" );
        }

You see that host and string are optional values, and are thus set to their 
defaults of null and zero.

This, the connection is:

_socket.connect(null, 0);

which of course, causes a SocketError.

I have attached an updated version of the class which should fix the issue (I 
havent tested it yet).

Original issue reported on code.google.com by mikechambers on 29 Jul 2010 at 5:14

@GoogleCodeExporter
Copy link
Author

Oops, noticed a bug in the file I uploaded. Should be fixed here.

Original comment by mikechambers on 29 Jul 2010 at 5:16

@GoogleCodeExporter
Copy link
Author

Finally compiled it and fixed another bug. Updated example attached.


Original comment by mikechambers on 30 Jul 2010 at 7:54

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant