Jump to content
  • Advertisement
Sign in to follow this  
Kaze

[web] Flash XmlSocket reciving problems

This topic is 3637 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Right now I have a C# server and a flash client using the xml socket. I can connect to the server and send data to the server but the client can't receive anything. The onData function never gets called, the problem could be on the server but I suspect the problem is with the client. On the server I write a string, write a 0 and flush the stream but the client doesn't get anything. I know this isn't a lot to go on but if anyone knows of common pitfalls or something I can do to narrow down the possibilities it would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
- Are you able to receive anything using an alternate client line Telnet?
- Have you looked at the to-ports attribute of your crossdomain.xml file?
- Would you be able to show us some relevant code that might assist us in tracking down the issue?

I'll try to think of more tests to perform.

Share this post


Link to post
Share on other sites
I completely forgot about using telnet to test the server.
Anyway I found out what was wrong, flash needs a 0 byte to delimitate the end of a message but,
Write(0);
Write((uint)0);
Write((byte)0);
Write((char)0);

don't seem to work but

char[] end = {0};
Write(end);

does for some reason.


Right now though I am having problems with policy files. The docs say I need one for a xml socket even though its hosted on the same machine as the server app. When it connects to the server it request a policy file but if I send one it disconnects anyway. Is their anyway I can make it throw a exception or something when it runs into a problem? I tried loadpolicyfile on a xml file but that also didn't do anything.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kaze
I completely forgot about using telnet to test the server.
Anyway I found out what was wrong, flash needs a 0 byte to delimitate the end of a message but,
Write(0);
Write((uint)0);
Write((byte)0);
Write((char)0);

don't seem to work but

char[] end = {0};
Write(end);

does for some reason.

If Write expects a string, then passing it a zero probably tells it to send nothing. I expect it's much like passing a NULL pointer in C++. You need a string with a zero in it, which is a different object.

Share this post


Link to post
Share on other sites
Anyway with the policy files when the client requests them I make the server send them but then the client disconnects.

Got user
Added 192.168.123.50:1591
got: <policy-file-request/>
policy sent
Socket Exception:
>Unable to read data from the transport connection: An established connection wa
s aborted by the software in your host machine.
Disconected 192.168.123.50:1591


I'm using

"<?xml version=\"1.0\"?><cross-domain-policy><allow-access-from domain=\"*\" to-ports=\"9000\" /></cross-domain-policy>"

but it would be really helpful if I could make flash return more information about whats going on inside.

Share this post


Link to post
Share on other sites
Flash will automatically disconnect after it receives the policy file, and then reconnect. If it's not reconnecting, either the policyfile is wrong, or your server isn't accepting new connections.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!