Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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 1220 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: 57
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: ?

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Pages: [1]
  ignore  |  Print  

ivj94 (586 views)
2018-03-24 14:47:39

ivj94 (49 views)
2018-03-24 14:46:31

ivj94 (383 views)
2018-03-24 14:43:53

Solater (63 views)
2018-03-17 05:04:08

nelsongames (110 views)
2018-03-05 17:56:34

Gornova (159 views)
2018-03-02 22:15:33

buddyBro (704 views)
2018-02-28 16:59:18

buddyBro (93 views)
2018-02-28 16:45:17

xxMrPHDxx (494 views)
2017-12-31 17:17:51

xxMrPHDxx (734 views)
2017-12-31 17:15:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!