Actionscript 3 :: Flash XML Socket Choking?
Feb 9, 2010
I'm trying to work out some kinks in a multitouch application I've built. It uses flosc to communicate with a xml socket server that sends the multitouch events. This all works fine and dandy for most of the time.
But if I'm mean and flood it with multitouch events Flash can't keep up with parsing the input, and the socket just keeps getting data that piles up until it either catches up or the whole thing crashes.
I have no problem discarding input once there's too much*, but I'm having trouble devising a clever way to do it.
* The app does 6-10 simultaneous inputs with no problem, things start to get hairy once I have to deal with 20+ which basically means someone is lying on the table ;)
View 1 Replies
Similar Posts:
Nov 19, 2011
When I send number (int)52 s.Send(BitConverter.GetBytes((int)872415232));, flash show me trace(socket.readInt()); 872415232 If i send 872415232, flash show 52.Why? And how it fix?
View 1 Replies
Apr 30, 2010
Steve Jobs just posted this article on why Apple rejects Flash... [URL] I agree that javascript and css can be used to replicate some of Flash's animation, though Flash does all sorts of scaling and tweening that is incredibly powerful, and I'm not sure that there's anything comparable in javascript, if there is, I certainly haven't seen it.
However, my question is about the socket. Flash has an incredibly powerful openSocket class that allows you to connect to a server and have the server and the client talk back and forth to one another. As far as I know there is no equivalent class in Javascript. Am I mistaken? Is there some secret mystery Ajax class that replicates the openSocket? If not, then that feature alone makes Flash an invaluable tool.
View 1 Replies
Jun 29, 2011
I'm creating a client-server game. My client is a flex based game, and my server is erlang server. At the beginning, when I test directly my flex client in flash player, I can establish a connection easily to my erlang server through socket connection. And both can exchange data with no problem. The problem rise when I deploy my flex app at Apache http server, and running it using a browser by calling [URL] my flex socket sends message requesting for a crossdomain policy to my erlang server. So I create an xml message that represent a crossdomain policy, and send it back to my flex app as a response for that request.
Yet still I can't establish any permanent socket connection between my flex client and my erlang server. I know this because I add listener on my flex socket that will modify its internal state to CONNECTED, if a connection between client-server has established.
View 2 Replies
Oct 8, 2011
I'm trying to connect an AIR application to socket.io, it's just not working.
[Code]...
View 1 Replies
Jan 1, 2010
I have moved on now to where this is clearly a Flash security thing.I have a flash client that attempts to connect to an open socket on the same host as the one on which it lives.I am able to connect successfully from inside the Flash IDE, and when I run the swf movie locally on my machine, after granting it security clearance in the white list it connects as well. However, when I call the movie via the browser (URL...) it fails to connect.The socket reports that a connection attempt is made but immediately disconnects.I have a crossdomain policy file that looks like this: in the root directory of the host.[code]In the flash movie I have a line that looks like this: System. security. loadPolicyFile (URL...);And I'm thinking maybe that's where the problem is, but the documentation on how to use this method is not entirely clear. I'm in Flash CS3
View 1 Replies
Apr 28, 2010
I am trying to connect to a socket server from flex. I read, on adobe's documentation, the client automatically sends a "request-policy-file" xml element to the socket before allowing it to be opened, and should receive a policy file.
The client sends the xml element as expected, My server receives it (on the port I want to use, port 6104) and replies on the same port with:
[Code]...
View 1 Replies
Sep 26, 2010
Is it possible to establish an SSL connection from a Socket in Flash?
View 1 Replies
Dec 19, 2010
I couldn't find an up to date example of how to create a socket (I prefer in php or c++) and how to make the connection with AS 3.
View 1 Replies
Dec 31, 2010
In my Flash app, I'm connecting to my server like this:
Security.loadPolicyFile("xmlsocket://example.com:12860");
socket = new Socket("example.com", 12869);
socket.writeByte(...);
socket.flush();
At port 12860 I'm running a socket policy server, which (according to this document) correctly serves up my policy like this:
[Code]...
I get no security warnings, which I used to get before the policy server was in place. Still, the connection to port 12869 doesn't work. It's made (I can see with Wireshark and on the server), but no data is sent by Flash. It might be worth knowing that the SWF itself is served from example.com as well.
View 1 Replies
Oct 6, 2011
I am trying to debug a socket connection issue between flash in a web browser and flash in a client type program. The connection is closing properly in the web, so I would like to understand how the web side of things work. Right now I can load up a remote flash file in a web browser and that triggers a connection ESTABLISHED stat when viewing with netstats -fn. When I close the dialog which runs some javascript to remove the flash from the dom, the connection stats goes to TIME_WAIT. Does the act of removing the flash from the html DOM sever the flash connection which triggers a TIME_WAIT state? How does that process work?
View 1 Replies
Sep 12, 2009
I was just doing some testing using PHP sockets and Flash. I used several things, one thing is this tutorial:I have the server running, and when I run the swf via Flash it connects fine. But when I run it from the browser it can't connect.. Because that Tutorial is in AS2, I also wrote a quick client to connect with AS3, but I'm having the exact same problem.. it only connects if I run it through flash.Here's an example of the basic code:
Code:
var s:Socket = new Socket('my IP', 5445);
s.addEventListener(ProgressEvent.SOCKET_DATA, getData);
[code].....
View 11 Replies
Apr 5, 2009
I'm writing my first AS3 class and basically I'm trying to take code from an AS3 .fla and incorporate it into the class. I've been getting plenty of errors, but this one seems to be at the crux of the problem:Code:1120: Access of undefined property socket.Here is all the code that is required to cause this error:
PHP Code:
package{ public class ScratchSocket { import flash.events.Event import flash.events.ProgressEventimport
[code]......
View 3 Replies
May 28, 2009
I'm considering writing a flash client using sockets to connect to a chat server that I've already written in C#. Unfortunately I don't have any AS experience so was hoping that someone might be able to point me in the right direction (to tutorials or the like for socket connections etc).
View 4 Replies
Oct 9, 2009
So, this is a copy of another post I made, but I get a sneaking suspicion I put the post in the wrong forum:[URL]..The summary:
The Socket class in flash player sometimes, for some users (across all sorts of OS and Browsers) will not ask for the policy file from port 843 first, but instead will go straight to the port of the outgoing request, which in this case is our game server, who doesn't really understand the request.
In every case so far the user *is* using the latest version of flash too, so it's not an issue without outdated policy methods, which would have been my first guess.For most people it works just fine, but I posted a log in the thread for one of the non-working players. It's pretty mysterious, and I haven't found a fix yet... though I'm going to experiment with some work arounds.
View 5 Replies
Dec 1, 2009
I'm trying to implement a binary protocol between a flash application and a Custom Java Server using TCP/IP sockets, the protocol's messages are of variable length, so my idea is to add a field indicating the number of bytes I have to read before parsing a complete message, something like this:[code]if while processing a message (supossing it is complete) other data arrives through the socket, are messages of type ProgressEvent.SOCKET_DATA queued so the number of times my handler is called is equal (at least in this case) to the number of messages arrived or should I read until all data the socket has available? or simpler: are in general messages for a handler queued in flash?
View 1 Replies
Feb 13, 2010
My webhost has rules against socket servers so I've been looking into GAE.
Does anyone know of a socket server that can successfully run on GAE? I'm using it for flash so anything like smartfox would be amazing if it's possible.
View 3 Replies
Mar 7, 2010
How to play mp3's from socket connections in Flash AS3?
I have some simple programm which is listening to some port (TCP).
I connect to it using as3 sockets and it starts sending me mp3 data
How to play that data?
View 1 Replies
May 30, 2010
Basically I'm using Flash to connect to a Java server.Despite my Java application replying to the <policy-file-request/>, in the Flash debug log it lists (not sure about the order as there are lots):
Security Sandbox Violation *
Connection to 192.168.1.86:4049 halted
Warning: Timeout on
[code].....
View 1 Replies
Aug 3, 2010
There is a flash movie which is using flash.net.Socket to connect to a server. But there could be a situation when the server is not running, hence nothing is listening on the port socket is connecting to.
When I do "telnet hostname port" I get a fast connection refused error. But flash.net.Socket does not invoke any event (see below), but silently waits for socket timeout. For me it is important to reduce time needed to detect non-existing server as much as possible to be able to reconnect to another server in the cluster.
I've tried the following events, but to no avail:
close
connect
ioError
securityError
socketData
None of these is invoked in such situation.
Is there a way to detect that TCP connection has been refused using flash.net.Socket?
View 3 Replies
Oct 3, 2010
So far the solution I found requires a crossdomain.xml to work,but this is not available on an IP camera:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()">
[code]....
View 1 Replies
Jan 21, 2011
Now I have server code on C++ program. But I don't know how to coding client socket on Flash AS3.0.
View 1 Replies
May 18, 2011
Basically, Im learning how the socket class works in AS3, seems pretty simple, but I dont know what port to assign in the second connect() parameter, let say I wanna load a image from the web, what should I have to do to figure what port is the right one?
View 1 Replies
Jun 1, 2011
I am migrating an application from flex sdk 3.4 to flex sdk 4.5.I am using a telnet example of AS3 tutorials as base to construct a generic socket class that implement a specific protocol.The main problem is that the new application with the validated socket class does not fire any event (no error - no connected - no data - nothing). The try catch with the connect method does not throw any error. I checked if the events were successfully connected, but they are not fired never.Update: I used the suggestions to modidy the code. Actually, now I am receiving an error on the security policy.
This is the constructor:
public function GenericSocket(server:String, port:int, output:TextArea) {
// set class variables to the values passed to the constructor.
[code].....
View 1 Replies
Jun 2, 2011
this is my flash as3 code :
var cam:Camera;
cam= Camera.getCamera();
var video:Video=new Video(200,200);
[code].....
View 1 Replies
Jul 21, 2011
In my project, I need to get some data dynamically from socket server. so i build following app:
[Code]...
View 1 Replies
Oct 3, 2011
I have a .fla file, that works with Socket class. There is a server(written in Delphi XE, but it does not matter). I connect to it from my .fla. When i execute my .fla from within Flash Professional CS5 everything works fine. But when i tried to execute resulting .swf from Explorer(Win 7, Flash Player 10) i got an error:
SecurityError: Error #2010: Local-with-filesystem SWF files are not
permitted to use sockets. at flash.net::Socket/internalConnect() at
flash.net::Socket/connect() at payterminal::TLogger() at
[Code].....
After all this, my .swf is still open in Flash Player with no errors, but the socket connection is not happening. I tried different crossdomain-files, but all my attempts led me to same result.
View 2 Replies
Jul 20, 2011
I'm trying to make a barebones, simple flash client communicate ANYTHING to a server over a regular socket. I setup the listeners:
socket = new Socket();
socket.addEventListener(Event.CLOSE, closed);
socket.addEventListener (DataEvent.DATA, onSocketData);
[code]...
And then I connect. On the server side I have a simple policy server on port 843.And then the real socket server that the flash client is connecting to.The flash client connects to the policy server and gets the policy. The flash client then connects to the actual socket server. I know this because I can both see it when snooping the network traffic and the fact that the Event.CONNECT fires off. From snooping the network traffic I can see the flash client send data TO the server when it:
socket.writeUTFBytes( "TEST CLIENT
");
From the server app I can see the data the client sent. The server then returns a little data. I can see this data going from the server to the client in the network traffic snooper. However, the client NEVER sees the data. It never fires off DataEvent.DATA or ProgressEvent.PROGRESS or ProgressEvent.SOCKET_DATA. There are no errors and the connection remains open for as long as I want it... but the flash client never seems to see the data... no matter how much I send.
Over and over I read online that the data sent to the flash socket needs to be terminated with a � zero byte. I can verify it is in the network traffic snoop.if I try to read any data from the flash app via something like readUTFBytes it always returns nothing found.
View 2 Replies
Sep 12, 2009
.to the letter after installing Apache and PHP on my pc. And i am geting really fraustrated because i cannot get the flash objects to connect to the PHP socket when they have been uploaded to the localhost server or any other online server. However it works no problem when i run the flash object straight from my HD. The socket is definately open because telnet connects to it fine.
My pc ip is 192.168.1.7. And when I transfer the flash object to any other pc on my lan, if it is on the hd, it connects to my pc no problem. However, if i were to type in http:[url]... it DOESN'T WORK.
View 14 Replies
Aug 9, 2011
I am using flash socket to connect to ftp and upload files. Its working fine in flash IDE but it give security error in browser. I have loaded policy file by Security.loadpolicyFile() also i have specified Security.allowDomain("*") but still it doesnt work. I have placed my crossdomain.xml at root level on ftp.
My crossdomain.xml looks like this..
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
[code]...
Yet there is security error...
View 2 Replies