Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Flash Client unable receive message from Java Server? Please help … (~_~)  (Read 511 times)
0 Members and 1 Guest are viewing this topic.
Offline chanphat01001

Innocent Bystander





« Posted 2012-07-15 05:42:00 »

0 down vote favorite
   

I am developing a Client-Server game, server is developed by Java Socket, client is developed by J2ME and Flash. Now, transfer data between J2ME Client with Server is OK, and we can play the game on mobile. At the same time, we also developed Flash Client to connect with Server and play the game with J2ME Client. When we run Flash Client on Flash Builder Editor, no problem happened about transfer data between Flash Client and Server, but when we released (export project) to test Flash Client on browsers such as IE or FireFox, many problems happened ...

First problem was Flash Client couldn't connect to Server, Server couldn't listens any request connection from Flash Client, but request connection from J2ME Client was still OK. After many hours searching on goolge, we found the solution for this problem. I fixed Server by creating a Thread listens "policy-file-request" on port 843 to respond content XML "policy-file-request" for Flash Client, then Flash Client connected successfully to Server... I thought everything will be OK, but next problem happened...

Second problem was Flash Client just receive only one a message from Server, I guessed Flash Client closed the socket after receiving a message from Server: when Flash Client login Server, it will send a message contains username and pass, Server will check this information, if account is exist, Server will send 3 messages to Flash Client: message 1-> detail information of user, message 2-> number unread messages of user, message 3-> information about newest version to update. Actually, Flash Client just received only one a message, it was message 1, after that it couldn't receive any message...after many hours found solutions on google, I didn't find any solution for the problem... and final, I tried my solutions. I created a Thread on Server to send message PING to client in order to keep connection from closing between Flash Client and Server, but this solution will slow network. I tried another my solution, every when client received a message from Server, Flash Client will send message PING to Server in order to keep connection for next message from Server. This solution is better, but sometime it worked, sometime it didn't work...

I am stuck at this problem ... hope get ideas from everyone, thanks all!
Offline jonjava
« Reply #1 - Posted 2012-07-15 11:42:12 »

I think this is a Flash specific question? If Flash gives you access to Sockets, I don't see why you would have to do such weird workarounds. I'm not familiar with Flash but as far as I can tell the problem lies with Flash and not with Java.

[EDIT]: Or more specifically, the Flash Client you've made. Perhaps it's partially denied access to network protocols or some such for whatever reasons.

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #2 - Posted 2012-07-15 11:47:25 »

0 down vote favorite

Copy+paste spam?

If you actually are human, then I assume you've read and followed this: http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html ?

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (11 views)
2014-08-28 18:26:30

CopyableCougar4 (24 views)
2014-08-22 19:31:30

atombrot (37 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (29 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!