Socket implementation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Socket implementation

Jairo
I´m developing a Mobile App with Flex and I need a connection with sockets. I downloaded Flashsocket. It connects and sends data with no problem, but if connection goes out, don´t reconnect.
Anyone saw this with Flashsocket or have some better socket implementation?

Reply | Threaded
Open this post in threaded view
|

Re: Socket implementation

clintm
make sure you're listening for and handling all the FlashSocketEvent events…
 (e.g. DISCONNECT)

package com.pnwrain.flashsocket.events
{
        import flash.events.Event;
       
        public class FlashSocketEvent extends Event
        {
                public static const CLOSE:String = "close";
                public static const CONNECT:String = "connect";
                public static const MESSAGE:String = "message";
                public static const IO_ERROR:String = "ioError";
                public static const SECURITY_ERROR:String = "securityError";
                public static const DISCONNECT:String = "disconnect";
                public static const CONNECT_ERROR:String = "connectError";
               
                public var data:*;
               
                public function FlashSocketEvent(type:String, bubbles:Boolean=true,
cancelable:Boolean=false)
                {
                        super(type, bubbles, cancelable);
                }
        }
}


On Tue, Feb 14, 2017 at 11:13 AM, Jairo <[hidden email]> wrote:

> I´m developing a Mobile App with Flex and I need a connection with
> sockets. I
> downloaded Flashsocket. It connects and sends data with no problem, but if
> connection goes out, don´t reconnect.
> Anyone saw this with Flashsocket or have some better socket implementation?
>
>
>
>
>
> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/Socket-implementation-tp14684.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Socket implementation

Jairo

Thanks Clint.

I´m listening for the events.. The connection event fires but the disconnect event don´t.

If I turn off my wi-fi the log window shows a message "webSocketError: Server Timed Out!!", but don´t fire a disconnect.

The Android implementation of socket.io that I used in another project reconnects automatically, as soon as the network wakes.





Em 14/02/2017 17:21, Clint M escreveu:
make sure you're listening for and handling all the FlashSocketEvent events…
 (e.g. DISCONNECT)

package com.pnwrain.flashsocket.events
{
	import flash.events.Event;
	
	public class FlashSocketEvent extends Event
	{
		public static const CLOSE:String = "close";
		public static const CONNECT:String = "connect";
		public static const MESSAGE:String = "message";
		public static const IO_ERROR:String = "ioError";
		public static const SECURITY_ERROR:String = "securityError";
		public static const DISCONNECT:String = "disconnect";
		public static const CONNECT_ERROR:String = "connectError";
		
		public var data:*;
		
		public function FlashSocketEvent(type:String, bubbles:Boolean=true,
cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
		}
	}
}


On Tue, Feb 14, 2017 at 11:13 AM, Jairo [hidden email] wrote:

I´m developing a Mobile App with Flex and I need a connection with
sockets. I
downloaded Flashsocket. It connects and sends data with no problem, but if
connection goes out, don´t reconnect.
Anyone saw this with Flashsocket or have some better socket implementation?





--
View this message in context: http://apache-flex-users.
2333346.n4.nabble.com/Socket-implementation-tp14684.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.


    

--
Reply | Threaded
Open this post in threaded view
|

Re: Socket implementation

clintm
Looks like it's a known issue with a workaround proposed.
https://github.com/simb/FlashSocket.IO/issues/21

On Tue, Feb 14, 2017 at 11:52 AM, Jairo França <[hidden email]> wrote:

> Thanks Clint.
>
> I´m listening for the events.. The connection event fires but the
> disconnect event don´t.
>
> If I turn off my wi-fi the log window shows a message "webSocketError:
> Server Timed Out!!", but don´t fire a disconnect.
>
> The Android implementation of socket.io that I used in another project
> reconnects automatically, as soon as the network wakes.
>