Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7401669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:32:02+00:00 2026-05-29T04:32:02+00:00

I have a C++ application which sends images to a Flex/Air front-end via TCP

  • 0

I have a C++ application which sends images to a Flex/Air front-end via TCP sockets. All this data transfer occur in the same host, so the socket connects to a localhost server.

The problem is that the Flex/Air takes a really long time to read the entire image from the socket. The server sends the image quite fast, but the Flex/Air reads this image in tiny parts. The whole image has about 300MB and the Flex/AIR reads only about 1KB each iteration. So the flex keeps calling the socket data callback, which is causing the application to slowdown.

Is there any synchronous sockets to use with flex, or some kind of socket which can read the entire data all at once? If sockets aren’t the best choice, is there any other faster options?

My socket class looks like this:

public class ClientSocket extends Socket
{

    public function ClientSocket(host:String, port:int)
    {
        super();
        addListeners();
        ...
        this.endian = Endian.LITTLE_ENDIAN;
    }

    private function addListeners():void
    {
        ...
        addEventListener(ProgressEvent.SOCKET_DATA, onSocketData);
        ...
    }

    private function onSocketData(event:ProgressEvent):void
    {
        try
        {
            ...
            var serverMessage:ByteArray = new ByteArray;
            readBytes(serverMessage);
            ...
        }
        catch(error:Error)
        {
            //Error handling
        }           
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:32:04+00:00Added an answer on May 29, 2026 at 4:32 am

    I think you need to change your solution if possible. You need a http server to host your images, and send the images’ filename(or url) to Flex front-end, then you can load them by URLLoader and only listen on “complete” event.

    I’m sure this will be faster ;o) Is this solution appliable?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Java application which sends pointer to function (callback) to some native dll
I have an application on my iPhone which sends out Http requests; is it
I've have an application with Android front end and Django as the back end.
I have a console application which screen scrapes some data, and now I need
I have a C++ application which communicates with a camera and fetches raw image-data.
I have a client application built in C# which sends an image along with
I have a simple application which sends an image (Base64 encoded) to a server,
I have an uploadify component, which sends the files back to rails application. The
I have a Qt application which needs to be able to send faxes. I'm
I'm writing an application which have to take a picture and send it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.