# Flash Socket Chat Trouble

**URL:** <https://forum.kirupa.com/t/flash-socket-chat-trouble/263326>\
**Category:** flash\
**Created:** [June 14, 2008, 3:09pm UTC](https://forum.kirupa.com/t/flash-socket-chat-trouble/263326 "2008-06-14T15:09:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tauguy](https://avatars.discourse-cdn.com/v4/letter/t/58f4c7/32.png) [@tauguy](https://forum.kirupa.com/u/tauguy)\
**Post date:** [June 14, 2008, 3:09pm UTC](https://forum.kirupa.com/t/flash-socket-chat-trouble/263326/1 "2008-06-14T15:09:58Z")

</div>

Hey all,

I have been following the tutorial at [http://www.kirupa.com/developer/flash8/php5sockets\_flash8.htm](http://www.kirupa.com/developer/flash8/php5sockets_flash8.htm)  
to make a socket based flash chat, but I’m having a bit of trouble.

At first it returned ‘Couldn’t connect to server’, I found the problem and set the server to ‘localhost’ and port ‘80’. Tried again, returned ‘Server connection estrablished’ but the moment I pressed the send button/enter it returned ‘Server connection lost’  
I twiddled the code a bit, and now it constantly returns ‘Server connection established’, and never disconnects. But the messages don’t show up.

Any suggestions as to how I can fix this? Is there anything in the code that needs changing depending on me or something?

Cheers

---

<div class="post-metadata">

**Author:** ![khaledqad](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@khaledqad](https://forum.kirupa.com/u/khaledqad)\
**Post date:** [June 15, 2008, 8:20am UTC](https://forum.kirupa.com/t/flash-socket-chat-trouble/263326/2 "2008-06-15T08:20:14Z")

</div>

Hi all  
my name is Immortal  
and I like ask ainy one how to make a flash component?  
thank you all  
regards  
Immortal

---

<div class="post-metadata">

**Author:** ![evanadelman](https://avatars.discourse-cdn.com/v4/letter/e/c5a1d2/32.png) [@evanadelman](https://forum.kirupa.com/u/evanadelman)\
**Post date:** [June 16, 2008, 11:22pm UTC](https://forum.kirupa.com/t/flash-socket-chat-trouble/263326/3 "2008-06-16T23:22:16Z")

</div>

I’m also using the code here:  
[http://www.kirupa.com/developer/flash8/php5sockets\_flash8.htm](http://www.kirupa.com/developer/flash8/php5sockets_flash8.htm)  
As the basis of my app - I’m finding windows computers are connecting just fine, but macs are getting an error. It _looks_ to me like it’s asking for the policy file - even though the php script & the chat are w/in the same domain. Any thoughts?

---

<div class="post-metadata">

**Author:** ![evanadelman](https://avatars.discourse-cdn.com/v4/letter/e/c5a1d2/32.png) [@evanadelman](https://forum.kirupa.com/u/evanadelman)\
**Post date:** [June 17, 2008, 3:58pm UTC](https://forum.kirupa.com/t/flash-socket-chat-trouble/263326/4 "2008-06-17T15:58:58Z")

</div>

thanks - i found my solution here::  
[http://djz.hu/blog/2007/07/26/php-socket-server-chat-gateway-for-flash-clients/](http://djz.hu/blog/2007/07/26/php-socket-server-chat-gateway-for-flash-clients/)  
The code there provides for a connection over 80 & also provides for the case where the client requests the policy file.  
In my case the policy file was being requested through the socket connection on Mac clients, but not on PCs for whatever reason, even though everything was being tested internally on a private IP address - ie, the test client was located @ [http://192.168.0.3/sockets/test.html](http://192.168.0.3/sockets/test.html) & the swf was opening a socket connection to 192.168.0.3 as well - so not really cross domain, but was asking for the policy file over the socket anyway.

All is good now - thanks for the response though!
