473,573 Members | 2,753 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

8 New Member
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(A F_INET, SOCK_STREAM, SOL_TCP) or die("Could not create socket\n");
// bind socket to port
$result = socket_bind($so cket, $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 incomingconnect ion\n");
// read client input
$input = socket_read($sp awn, 1024) or die("Could not read input\n");
[/SIZE][/FONT][FONT=Arial][SIZE=2]$output = "Hello"."\0 ";
socket_write($s pawn, $output, strlen ($output)) or die("Could not write output\n");
[/SIZE][/FONT][FONT=Arial][SIZE=2]// close sockets
socket_close($s pawn);
socket_close($s ocket);[/SIZE][/FONT]
[FONT=Arial][SIZE=2]?>[/SIZE][/FONT]


<code> for flash client to connect only
// Create your XMLSocket object
var mySocket:XMLSoc ket = new XMLSocket();
text1.text = mySocket;
// Connect to your site
mySocket.connec t('myIPaddress' , 1234);
mySocket.onConn ect = function(succes s) {
if (success) {
text2.text = "Server connection established!";
} else {
text2.text = "Server connection failed!";
}
}
</code>
Mar 22 '07 #1
3 3408
iam_clint
1,208 Recognized Expert Top Contributor
you were able to telnet to it?


http://www.adobe.com/support/flash/a...ionary860.html
Mar 22 '07 #2
doc
8 New Member
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 New Member
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
2257
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 point. System.Net.IPAddress IPAddress = System.Net.IPAddress.Parse(strPrtrIPAddr); System.Net.IPEndPoint IPEndPoint = new...
4
16817
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; socket.Connect(ipe); isConnected = socket.Poll(30*1000000, SelectMode.SelectWrite); I would have expected that once I set the socket to...
2
26488
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 for a incoming connection,the relative code snipprt as following:: private IPAddress myIP=IPAddress.Parse("127.0.0.1");
1
1365
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 fine) Now, i want this client app to be able to connect to my server from outside the lan as well... Like i would like to give my user the...
14
25247
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 tried a test, and I can't bind two sockets to the same port/ip but I can connect with one socket, and bind with another to the same ip/port. Thanks
0
2412
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 php 5). My php socket server responds correctly when I connect to it with a php client socket but I cannot connect with the flash xml client socket....
2
2197
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 a TCP daytime client using perl calls directly
1
7139
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 site, which is actually for sending strings. I tried to adapt this code so that the client sends an image instead of a string. However, there is...
3
11647
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' "Unix network programming" book described a TCP server (tcpcliserv04.c) and client (tcpcli04.c). I compiled and executed them successfully as follows:...
0
7788
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7707
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7799
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8080
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6430
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5296
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3742
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2226
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1320
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.