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


Similar Posts:


ActionScript 3.0 :: Split Rectangle Into N Smaller Rectangles And Then Recombine?

Aug 23, 2010

We have a 100 by 100 px square.

How would one split this up into N number of random x/y rectangles?

And more crazy, how could you then position these back in order?

I checked out 2d Packing but its not really what im after.

View 0 Replies

Flash :: RST Packet Sent By The Server?

Nov 4, 2009

I am developing a client in Flash and using http req/resp to communicate with the server. For a while the session works fine and then the connection is terminated by the server. I did a wireshark sniff at the server and the last message which it sends is a RST packet. Also it happens only when I'm using IE and the server and client are in different domains. This does not happen in FireFox. I have been struggling to find a sol, till I found this thread. It's a bit old but I am not sure if this bit of info is important but I am connecting to the server via a gateway.

View 1 Replies

Flash :: Packet Loss Calculate In Flex

Feb 21, 2012

How I can calculate packet loss from Flex.

View 1 Replies

Flash :: Packet Loss Calculate In Flex?

Feb 21, 2012

How I can calculate packet loss from Flex.

View 1 Replies

Actionscript 3 :: Set The TTL Of A UDP Packet?

Jul 6, 2011

I want to make traceroute in the browser via flash. I asked about ICMP packets, but another alternative would be UDP packets if I could set the TTL. However, I don't see that option in flash.net.DatagramSocket.

View 1 Replies

Flash :: Packet Loss Test Like In Ping Test From Flash Technologies?

Feb 22, 2012

Does any one have a idea about how to do a packet loss test like in ping test from flash technologies (Flash or Flex)?

View 1 Replies

ActionScript 3.0 :: External SWF Loading Insanities When Packet Arrived

Jun 1, 2009

My script is loading an external SWF. Everything runs smoothly during the load. But when the packet arrives, I noticed that something else is inside: insanity.

How to reproduce:
- Create two flas
- In the first one, write the following in the first (and unique) frame: //
- In the second one, write the code to load the first:

Code:
trace("1")
var loader:Loader = new Loader()
loader.load(new URLRequest("Untitled-1.swf"))
stop()

Run the first to produce the swf, then the second. The output will be an endless stream of "1"s, clearly showing that it's looping. But the loader wasn't even added to stage yet and it has no action to play the main movie! And now, for the craziness coup de grace: remove the "//" from the first fla and export it again. Bingo, no more endless loops.

View 6 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

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

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

Media Server :: Detect Packet Loss Or Other Quality Metrics For Inbound Streams?

Aug 5, 2011

So we're trying to come up with a way to automatically assess the "quality" of streams published to an FMS. So far, I've come down to 3 different statistics:

* Round-trip ping time to client (using the Client.ping() method and Client.getStats().ping_rtt.

* A home-grown jitter calculation that compares the deviation between wallclock and media time for an inbound stream, e.g., I get N+/-M seconds of media over a period of N seconds of wallclock time. How big is M on average? (uses Stream.time and Date.getTime()).

* How much packet loss are we getting?

For this third metric, I have the client sending up period reports containing tuples of <media_time, cum_bytes_sent>, where media_time is provided by NetStream.time and cum_bytes_sent is provided by NetStreamInfo.byteCount. I'm then comparing these samples to a similar set of samples obtained on the server via Stream.time and Client.getStats().bytes_in. Unfortunately, these two data sources do not seem to be measuring exactly the same thing. While they are close to each other, the received bandwidth (e.g., measured by the server) always seems to exceed the sent bandwidth (measured by the client) by a small amount (e.g., 0.5% to 2%) on a clean network.
 
The goal of this whole exercise is to enable to server to automatically detect when a client is having problems (either network or local CPU). Among other things, this will trigger us to tell the client to try sending a lower-bitrate stream.

So, my questions:
 
* Is there a method for me to reliably calculate (or obtain) a packet loss factor?  With something like RTP, I could simply look for holes in sequence numbers, but I don't see any APIs that would give me that sort of information via FMS (our inbound streams are usually RTMFP).

* If there isn't a way for me to get a clean packet loss factor, is there another quality metric I should be looking at?

View 12 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

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

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

Flash :: Split Youtube Video ID?

Sep 28, 2011

src="http://www.youtube.com/v/R5zKIOTvfwQ?version=3"

and

src="http://www.youtube.com/v/R5zKIOTvfwQ"

How can I get the video ID alone from this src?

Is there any predefined option available for that?

View 1 Replies

Actionscript :: Split Packets In Flash, XMLSocket?

Aug 27, 2010

I believe my flash client is losing some packets the server sends, because some packets get joined together hence I believe it drops them.Here is my packetHandler in flash

private var xmlsock:XMLSocket;
this.xmlsock = new XMLSocket();
xmlsock.connect("127.0.0.1", 1234);[code].......

A possible packet I sniffed sent by the server was.

u:105.w. aka (75 3A 31 30 35 00 77 00)

so the waiting packet never came in.

View 2 Replies







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