CyberCircuits / tinkerit

Automatically exported from code.google.com/p/tinkerit
0 stars 0 forks source link

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

Attachments:

GoogleCodeExporter commented 9 years ago
Oops, noticed a bug in the file I uploaded. Should be fixed here.

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

Attachments:

GoogleCodeExporter commented 9 years ago
Finally compiled it and fixed another bug. Updated example attached.

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

Attachments: