473,395 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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

8
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!

Thanks

doc

Working socket code (in php webpage, not as daemon yet)
[FONT=Arial][SIZE=2]<?php
// set some variables
$host = "my ip address";
$port = 1234;
// don't timeout!
set_time_limit(0);
// 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
socket_close($spawn);
socket_close($socket);[/SIZE][/FONT]
[FONT=Arial][SIZE=2]?>[/SIZE][/FONT]


<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!";
}
}
</code>
Mar 22 '07 #1
3 3391
iam_clint
1,208 Expert 1GB
you were able to telnet to it?


http://www.adobe.com/support/flash/a...ionary860.html
Mar 22 '07 #2
doc
8
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.

Cheers

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


http://www.adobe.com/support/flash/a...ionary860.html
Just tried to telnet to php socket server and it works fine.

doc
Mar 23 '07 #4

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

Similar topics

4
by: faktujaa | last post by:
Hi, I am having some problem with callback used in socket implementation. private static void Connect(string strPrtrIPAddr, int intPrtrPort, ref Socket rsocClient) { try { // Create remote end...
4
by: Joe Kinsella | last post by:
The following code behaves differently from what I would expect: socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, System.Net.Sockets.ProtocolType.Tcp); socket.Blocking = false;...
2
by: zhebincong | last post by:
Hello: I write a multithread c# socket server,it is a winform application,there is a richtextbox control and button,when the button is click,the server begin to listen the socket port,waiting...
1
by: batista | last post by:
Hi, My problem is that i have a client which was, uptil now, running inside a lan and using sokcet communication to connect to server which is also insdie the same lan.....(it was all working...
14
by: DaTurk | last post by:
I am makeing a Multicast server client setup and was wondering what the difference is between Socket.Connect, and Socket.Bind. It may be a stupid question, but I was just curious. Because I...
0
by: doc | last post by:
Hi Hard to know where to post this and I don't want to double post it - please move it if you need to, I am trying to connect a Flash client socket (XML) to a php socket server (using Flash 8 and...
2
by: sasimca007 | last post by:
Hello friends, When i used the following code and run i have an error: connect: Connection refused at sock.pl line 20. The code is: #!/bin/perl -w # Example of...
1
by: keksy | last post by:
Hi every1, I am writing a small client/server application and in it I want to send an image asynchronous from the client to the server through a TCP socket. I found an example code on the MSDN...
3
by: TsanChung | last post by:
I want to make a java TCP socket client to communicate with a TCP server socket on linux. Are there some sample C unix server and java client socket programs available? The Richard Stevens'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.