472,145 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

What will a flash xml socket connect to - please help - insanity is near

What will a flash xml client socket connect to?

I have a working php TCP/IP server socket bound to a port >1023 and the flash client will not even connect to it. I can connect to it with non-xml client.

Can anyone explain this to me - it has been driving me mad for weeks!

Please help!



Working socket code (in php webpage, not as daemon yet)
// set some variables
$host = "my ip address";
$port = 1234;
// don't timeout!
// create socket
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die("Could not create socket\n");
// bind socket to port
$result = socket_bind($socket, $host, $port) or die("Could not bind to socket\n");[/SIZE][/FONT]
[FONT=Arial][SIZE=2]// start listening for connections
$result = socket_listen($socket, 5) or die("Could not set up socketlistener\n");
// accept incoming connections
// spawn another socket to handle communication
$spawn = socket_accept($socket) or die("Could not accept incomingconnection\n");
// read client input
$input = socket_read($spawn, 1024) or die("Could not read input\n");
[/SIZE][/FONT][FONT=Arial][SIZE=2]$output = "Hello"."\0";
socket_write($spawn, $output, strlen ($output)) or die("Could not write output\n");
[/SIZE][/FONT][FONT=Arial][SIZE=2]// close sockets

<code> for flash client to connect only
// Create your XMLSocket object
var mySocket:XMLSocket = new XMLSocket();
text1.text = mySocket;
// Connect to your site
mySocket.connect('myIPaddress', 1234);
mySocket.onConnect = function(success) {
if (success) {
text2.text = "Server connection established!";
} else {
text2.text = "Server connection failed!";
Mar 22 '07 #1
3 3233
1,208 Expert 1GB
you were able to telnet to it?

Mar 22 '07 #2
Not tried that - I was able to use a php client socket though. I appreciate that in that case I was using a server sided programme whereas the flash in client sided (as telnet would be) so perhaps I need to check that out.


Mar 22 '07 #3
you were able to telnet to it?

Just tried to telnet to php socket server and it works fine.

Mar 23 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by faktujaa | last post: by
4 posts views Thread by Joe Kinsella | last post: by
2 posts views Thread by zhebincong | last post: by
1 post views Thread by batista | last post: by
2 posts views Thread by sasimca007 | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.