x
login register about faq

Flash Client unable receive message from Java Server? Please help … (~_~)

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!

more ▼

asked Jul 15 '12 at 01:27 AM

chanphat01001 gravatar image

chanphat01001
2 3 3 3

(comments are locked)
10|600 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x28
x1
x1
x1

asked: Jul 15 '12 at 01:27 AM

Seen: 867 times

Last Updated: Jul 15 '12 at 01:27 AM