Flash - AMF Sockets Out Of Sync When Using ServerSocket In AIR?

Mar 2, 2011

I have two (+) systems on a local network running an AIR application that need to send/receive updated positions and other events between each other. I'm currently using an AIR-based socket server one of the instances. The AMF and strong typing works great. What doesn't, however, is the syncing between clients.

In my example below, clientA is trying to send an AMF packet to clientB. The SOCKET_DATA events fire off as expected on the server, in sync with the mouse, however the data that clientB receives very quickly gets out of sync and events are lost.

It's fine if an occasional event gets dropped, however I need to know the most recent SOCKET_DATA event has the latest data. Instead, it just contains increasingly older data.

Code Snippets:

clientA writeObject: (on MOUSE_MOVE to test large number of events)
protected function stage_mouseMoveHandler ( pEvent : MouseEvent ) : void
{

[code]....

View 1 Replies


Similar Posts:


Flash - Have A XMLSocket On The Server Side For AIR ServerSocket?

Jun 28, 2011

I have two software to create with AIR: a server and a client. Both with AS3 and AIR.I want to avoid having a big architecture with Remote Shared Object, or using BlazeDS, or having to set a Java / Python / ... server in the middle.In order to avoid having to parse socket data in the server and in the client side, I thought about using XMLSocket on the client side: the data arrives in a way which is already parsed by the Flash framework.However, when I use this XMLSocket with the AIR ServerSocket, the "connect" event returns me a raw Socket on the server side. So I have to manually manage the XML data on the server side.

Is there a way to also use an XMLSocket on the server side to communicate with the client? A kind of trick to convert the returned Socket into an XMLSocket?If there is an AS3 library which manages that, I did not find it.

View 2 Replies

Actionscript 3 :: AIR Application Fails To Start ServerSocket Then Published

May 27, 2011

I have strange problem, then I test AIR application in Dev mode - it creates working ServerSocket object. And acts as a server normally.If I package it as AIR app and install on windows it stops working - server is not created on designated port..[code]Or may it be because I am using generated Certificate?

View 1 Replies

Php :: Php-Flash Communication Over Sockets?

Nov 5, 2009

I am not any kind of network programming pro, but it happened that I have faced necessity to develop socket-server on php (no way for using Java) for flash multiplayer browser-game (standard features like locations, team battles, etc).

The main problem is that TCP is point-to-point protocol and it completely occupies given port.Of course it is possible to create some kind of queue, which will manage connections to the socket, but this solution doesn't seems to be the fittest one.

It seems to me that using interval of "fair" ports (from 2000 to 2200, for example) is more fitting solution, because one request may take a lot of time to execute and players won't be happy to wait in queue.

But how can I implement this "port inteval" strategy?The solutions that I see are:

launcing php-script per every port (he-he, 2 hundreds of launched scripts!);somehow forking the initial process to new processes (2 hundreds of processed? Not nice too), one for every port;additional while-loop, which listens all the ports (looks very bad);using threading or something like that (the problem is that php is single-threaded, as far as I know; pcntl?).But somehow I don't like any of them, or at least don't know how to implement them in the best possible way.

What is the best existing strategy to handle multiple requests from multiple users per time unit without delays, and how to implement this strategy in php? We have our own Debian-server, so it is possible to use any required php extensions.

For example, if we are trying to develop chat application, we need some sort of fixed (I mean persistent) connections for each user. For example, we have 80 users in chat, and then one of them posted a message, which server tries to handle and send to all other connected users, also putting an entry to the history file or something like that.

In this situation polling server for new messages every 10 seconds from each of 80 users is craziness, so the need in persistent connection gets obvious.But I don't know what is the best way to implement something like this, considering that not all requests are handled instanlty.

View 2 Replies

Flash :: Max. 3 Sockets From One Client?

Mar 26, 2011

I was trying to write a stress tester for my own protocol when I stumbled up on this problem.Anytime I create more than 4 connections from one PC Flash denies to receive anymore messages from the server although I'm still able to connect, and write messages.

View 1 Replies

WebSockets Vs Raw TCP Sockets In Flash

May 11, 2011

What WebSockets add to raw TCP connection?Why should I use WebSockets?I'll have only Flash clients, no need to support Javascript clients.

View 1 Replies

ActionScript 2.0 :: Communicate Through Sockets In Flash Mx?

Jan 21, 2003

it may be a stupid question what i'm going to ask, but i'll ask anyway ... just had an idea... is there a way i can comunicate through sockets in flash mx?

View 2 Replies

ActionScript 2.0 :: Flash Directly Use Sockets?

Oct 29, 2006

As the title says, I would like to know if Flash 8 or any version of flash can access sockets.For instance like winsock does. Using an IP and a port to send packets? I've seen it can connect to databases, but I haven't seen anything with it working with sockets, for instance a P2P chat using only an IP and a port to send an receive messages.

View 1 Replies

Flash :: Professional - Use The Sockets - Setup Server?

Feb 10, 2010

i'm trying to develop a multiplayer game in AS3, but i don't know how to use the sockets, how to set up my server, actually i don't know how to start, i want to build a peer to peer game, which will have a "room" to find players, it will be a cars game, i already have all the rest of the game, i just need to be able to make it multiplayer

View 3 Replies

HTML5 Web Sockets (TCP Connection) With Flash Fallback

Sep 20, 2010

I read about a project that enables the developer to program a HTML5 web sockets application that is compatible with older browsers by automatically falling back to using a flash method.

View 1 Replies

Http - Node.js And Sockets For Browser And Flash?

May 12, 2011

doing a project where the deviceorientation-data from smartphones get transfered to a socketserver, and from there to a flash-application.Now creating a http-server with nodejs wasn't too hard, and connecting from a smartphone via browser and transfering the data with socket.io worked fine.The problem comes with flash, i couldn't manage to connect my flash application to the http-server running socket.io. I figured out when i run a node tcp-server connecting from flash is no problem, but i have no more session management and i can't connect from the browser anymore.

View 1 Replies

C++ :: Recombine Split TCP Packet With Flash Sockets?

May 20, 2011

I have a program in c++ that sends a socket of 23723 bytes to a flash player in one "shot".The flash player sometimes receives two packets of size 17520 and 6203, and other times it receives a single packet of 23723.

EDIT: There does not seem to be a way to obtain the total number of bytes associated with the send data from flash. This would make it very difficult to build a loop to reconstruct the "broken" packet.I thought TCP was supposed to correctly recombine the packets and I am having difficulty recombining them myself.This is my receiving handler in flash:

var socket:Socket = new Socket();
socket.addEventListener(Event.CONNECT, socketConnectHandler);
socket.addEventListener(ProgressEvent.SOCKET_DATA, socketDataReceivedHandler);[code]...

will at times print 23723, and at other times, will print 17520 quickly followed by 6203. The total size are just examples and are subject to change for each send sockets. Also many sockets can be sent or received at the same time, so the split packets can be inter-mixed. In c++ I could determine what the total size of the sent data was, even if I did not receive the whole sent data yet.

View 2 Replies

ActionScript 3.0 :: Connect Flash To A Server Using Sockets Connection?

Oct 5, 2009

how to connect Flash to a server Using Sockets connection using in AS3.

View 16 Replies

ActionScript 3.0 :: Flash Sockets - Output Progress Event

Jan 11, 2011

Has there been any word on when the output progress event is being implemented? At the moment flash sockets are useless at uploading anything other than basic text files or maybe images because we are unable to control the amount of data being sent. The way I see the output working at the moment is when trying to send large files, the input buffer becomes flooded and in the process of trying to transmit so much data at the same time, many packets are lost. I tested this by trying to transfer a 570mb AVI to an ftp server.  By the time it got there the file was only 37mb. The event would allow us to calculate the network speed of the system doing the uploading and the speed of the server doing the downloading so that the buffer size and intervals can be optimized.

View 1 Replies

Flash :: Sockets - XMLSocket Can Receive Data But Not Send

Dec 20, 2010

I am attempting to connect to a python twisted socket server with Flash using XMLSocket. The connect works fine, and so does the receive. However I can't send data to the server. Is there a specific format I should be using? The reason I ask is because I couldn't read any data with the XMLSocket until the data was in the form "something", that is, the data string had to be valid xml followed by the null character. Is there a trick to sending data?

I don't think this a cross site security problem, because if it was, I believe I wouldn't be able to connect or receive. I am able to connect to the server using telnet and a java client without issues. EDIT: I figured it out, the problem was my server needed to have the data sent to it end with"

View 1 Replies

Flash :: Framework To Pass Objects Between Java And AS3 Using Sockets?

Jul 4, 2011

I want to a framework to pass objects between Java and AS3 using sockets. It should be something with good performance (not XML, JSON). I have looked into AMF but all of the tutorials are very complex and not about what I need. I have used java to java serialization but I can't find any tutorial about Java to AS3.

View 4 Replies

ActionScript 3.0 :: Java-Flash Communication With Sockets And AMF Coding?

Oct 17, 2010

I'm bothering with Java-Flash communication. At the beggining, I used XML Socket Class, which was pretty easy to implement and my aplication comunicated very well.However, my program will monitor behavior of many users at the same time, so parsing and sending large xml files could overload Server. Thats why I used Socket class and AMF coding instead. After tough hours of implementing it, whole application seemed to work. Unfortunently, after couple of tests it apeard, that Socket was slower than XML Socket! I have no idea why, because in theory binary messages should be much faster than xml. Could you help me solving this issue? Below I pasted my code for both Java and AS3.

This code sends basic variables from class object and are received the same way (it can sound bit complicated compared to just sending whole object, but for various reasons is the only way).

1. Java client (java server receives data from different sources and sends it to flash):

Code: public void sendMyPosition(MyPositionMessage message, Socket sock) throws IOException
{
synchronized (sock) {[code].....

2. Flash server - new data triggers socketDataHandler which receive it with readReasponse function. First int describes which kind of message was send, although there is only one at the moment. I've deleted some handlers couse they seemd irrelevant this case. Whole AS Class is attached as a file.

Code:
public class CustomSocket extends Socket {
private var currentMessage:int = -1;
private var message:Object = null;[code]................

View 1 Replies

Flash Pro Or Flash Builder To Make Graphical Web Widgets With Sockets?

Oct 6, 2010

I've contacted Adobe sales and tech support, and realized that I need to talk to someone who actually develops with these tools.I want to develop some simple graphical widgets with the ability to reload themselves via an xml-socket a couple of times a second. Which Adobe tool should I buy-- Flash Builder, or Flash Pro?

View 1 Replies

Sockets :: Can Flash App Running In Browser Connect To Localhost To Get Data From Another App?

Dec 21, 2009

it seems that Flash was supposed to run in a sandbox in the browser. But, if Flash can get data from a remote server, can it similarly get data from localhost IP on the same machine? In other words, can I use a Windows app that provides a TCP socket on localhost to feed data into a Flash app?the answer is yes at least for the case of an SWF file hosted in the file system, URL...(turns out the localhost access error can be fixed if you add the SWF app to some security whitelist). Still wondering if this can also be done for SWF apps hosted on the network.

View 1 Replies

ActionScript 3.0 :: Flash Binary Sockets - Error 2048 Returns

Dec 1, 2009

I'm creating a Flash IRC client for a project, and it works fine locally. However, when I place the SWF on a server it returns the #2048 error. I've tried to load in a policy file with no luck.

View 9 Replies

Lip Sync To Sound In Flash Movie

Jan 29, 2010

I have a sound in my flash movie and I'm trying to lip sync to it but for some reason when I try to move that red thing across the frames to play the sound across it so I can go to each syllable so I can work the lips to it. But when I run the red thing across the frames there is no sound going through the speakers. When I ctrl-enter and play the swf I hear the sound what should I do?

View 2 Replies

ActionScript 1/2 :: Sync Two Flash Banners?

Feb 3, 2010

I was wondering of any methods to sync two flash banners? What I mean is  that when the page loads neither banner starts until both are ready? I will have two flash banners like this: |Banner 1| (something else between them, html css) |Banner 2| Both banners will contain video, that needs to be played in sync. Any ideas? I would prefer AS2, because the site I will run these two  banners on prefers AS2. I read something about LocalConnection in AS3, anything similiar in AS2?  And does it work on all OS / browsers? Can it be done with Javascript?

View 3 Replies

Flash :: Professional - Audio Out Of Sync

Aug 14, 2011

I have an animation that I am exporting as either a .wav or .mov file then editing in different software but when I import the new file it is out of sync. That sounds confusing so I will explain. The project is a cartoon and a temp dialogue track was created before animation started. Then that temp track was used to animate over and do lip synching. Recently, actors have re-recorded the original temp dialogue track.  So, I need to export the original dialogue track out of Flash, use an editor, in this case Final Cut Pro, and replace the dialogue then export that as an audio file and bring it back into Flash.

But it is always out of sync. I have even exported a .wav file from Flash then immediately re-imported it and put it on the timeline and it is already out of sync. And it is the exact same audio! I don't even know how that could be possible. Surely if you export a wav from Flash and then re-import it, it should be exactly the same.

View 8 Replies

ActionScript 3.0 :: Flash XML Sockets - Get A Simple Socket Server Test To Work?

Jul 11, 2010

I've benn trying to get a simple socket server test to work for days now and it seems I'm not getting very far.Basically I just want to send some data from flash to the php script and have it echo it out, or anything at all like that I've been working from this tutorial http[url]....I have this basic flash class which just sends a string to the server:

Code:
package{
import flash.net.XMLSocket
import flash.display.MovieClip[code]...

The server side php is the attached script (pretty much this http:[url]....So I keep the php running on my server then run the as class, what happens is after a while (presumably the 15 second script limit in as) I get this error:

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: .../networking.swf cannot load data from website.com:9980.at base()

View 1 Replies

Actionscript 3 :: Ignore Large Amount Of Sites With TCP/IP Sockets Policy File For Flash

Apr 20, 2011

I'm using flash sockets to build an embedded chat application. everything works great. I want to allow all the sites who embedded this application to connect to my server, except for some sites.

My problem is that the number of sites that I don't want to connect to my server is a very large one( 4-5k). Currently from what I seen all you can do is tell in your policy file the domains that you allow/not allow.

What I'm looking for is a way for flash player to send me the domain where the flash is embedded and I could return an accept/decline response. I know I can send info about the site where the flash is embedded using actionscript, but this can be very easy simulated.

View 1 Replies

Keep Files Between Flash Drive And Computer In Sync?

Nov 23, 2011

I have a computer and a flash drive that both have the same homework files. I take the flash drive to and from school to work on homework, and I have to manually update those files onto my computer. How can I automatically have the files on my flash drive update the files on my computer?

View 2 Replies

Flash - Keeping Audio In Sync With Video?

Dec 5, 2011

I have a project that involves playing back a video clip within my swf movie. The video clip plays fine on its own, but when brought into flash the video and audio become out of sync and the movie quality suffers dramatically. I have tried embedding and streaming.

View 1 Replies

ActionScript 2.0 :: Methods To Sync Two Flash Banners?

Feb 3, 2010

I was wondering of any methods to sync two flash banners? What I mean is that when the page loads neither banner starts until both are ready? I will have two flash banner like this:

[Code]...

Both banners will contain video, that needs to be played in sync. I would prefer AS2, because the site I will run these two banners on prefers AS2. I read something about LocalConnection in AS3, anything similiar in AS2? And does it work on all OS / browsers? Can it be done with Javascript?

View 1 Replies

Embedded Flash Videos - Audio And Video Sync?

Feb 28, 2008

Im having serious issues making a video sync with audio inside an embedded flash video file.

View 2 Replies

ActionScript 3.0 :: Way To Turn Vertical Sync On For Flash Player

Feb 24, 2010

Is there any way to turn vertical sync on for the flash player using Actionscript 3 code? I figured it would be in the stage properties somewhere but am unable to find it anywhere. I also asked this question on several large flash/actionscript boards on the internet and haven't found anyone that knows how to do this. Turning on vsync will simply align the flash players screen updates with the updates of the monitors refresh rate. The result, liquid smooth.Without it, it's not perfect and so something needs to be done about this because we know flash is awesome and it needs to be perfect.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved