how to listen socket error event while sever not reachable

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

Post Reply
minzojian
Posts: 16
Joined: 11 Nov 2010, 09:38
Location: 41

how to listen socket error event while sever not reachable

Post by minzojian »

hello guys,i tried to add event listener on
SFSEvent.SOCKET_ERROR
and
IOErrorEvent.IO_ERROR
and try to check as if the server is connectable.so i shut down sfs before i run client.
but i only got is SFSEvent.CONNECTION and tell me that bulebox cannot be connected
and the output info like these below

Code: Select all

## SocketError: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error。 URL: 127.0.0.1"]
## BlueBox Error: Error #2032: Stream Error。 URL: http://127.0.0.1:8080/BlueBox/BlueBox.do
it looks the socket error really occurred,but the listener can't catch it
WHY?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

hi. I think that when the server is not reachable, it fires a SFSEvent.CONNECTION event with evt.params.success = false.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
secret007
Posts: 58
Joined: 29 May 2009, 06:27

Re: how to listen socket error event while sever not reachab

Post by secret007 »

Yes, its going in connection e.params.success = false, but from there one question arises that why they include SOCKET_ERROR event in SFSEvent class?
whats the use ....
======================================================
Choose a job of your choice and you will never have to work in life !!!
NewJersey
Posts: 27
Joined: 12 Mar 2012, 07:56

Re: how to listen socket error event while sever not reachab

Post by NewJersey »

I have the similar question as when using BlueBox it throws a sandbox violation error.

I am handling the event.params.false already.

Is SOCKET_ERROR the way to go?

Cheers,

NewJersey
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: how to listen socket error event while sever not reachab

Post by Lapo »

Are you using SFS2X final and the related API? If not please update
Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
NewJersey
Posts: 27
Joined: 12 Mar 2012, 07:56

Re: how to listen socket error event while sever not reachab

Post by NewJersey »

I am using the final version.

Was there any updates on the Client API's? Maybe that's the problem...:S

Will try ensuring I have the latest SWC's

Cheers,

NewJersey
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: how to listen socket error event while sever not reachab

Post by Lapo »

Check the SmartFox.version field, it should say 1.0.x
Lapo
--
gotoAndPlay()
...addicted to flash games
NewJersey
Posts: 27
Joined: 12 Mar 2012, 07:56

Re: how to listen socket error event while sever not reachab

Post by NewJersey »

I have the version 1.0.2 and the error is there!

Weird, isn't it?

Cheers,

NewJersey
Post Reply