Sandboxed problem Resolution for C + + sockets and Flex AS3 communication

Source: Internet
Author: User

Address:

Http://www.cnblogs.com/sevenyuan/archive/2012/06/20/2556494.html

A new socket server can be opened to listen on port 843, specifically for processing AS3 sent sandboxed requests. After processing, then close the connection.

An extra question.

AS3 reads the data sent by the C++socket, prompting for a file end error.

In case of Error:error #2030: Encountered a file tail error, please use: str=socket.readutfbytes (socket.bytesavailable);

Some of this errors was thrown if the proper listener is not added.

is listening for and asyncError ioError events from your netconnection?

If not, just give it a try.

Amount, finally understand, not the problem of the server, is not the problem of line break, is the TCP/IP communication protocol problem, seemingly Java direct read does not appear this problem, the above Java server each time the client's data is correct, AS3 has this problem, Is that every time you read the time without reading the whole byte stream, to verify the integrity of the packet, when the packet length >= the length of the server packet, then read the words will not appear above the problem.
For example, put if (_socket.bytesavailable >= 4)
{
cmd = _socket.readunsignedint ();
Ondeal (CMD);
}
Change to if (_socket.bytesavailable >= 20)
{
cmd = _socket.readunsignedint ();
Ondeal (CMD);
}
The client will read the correct data

C + + socket resolution for sandboxed communication with Flex AS3

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.