Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot send Ping Frame #6

Closed
zzzhr opened this issue Apr 30, 2012 · 5 comments
Closed

Cannot send Ping Frame #6

zzzhr opened this issue Apr 30, 2012 · 5 comments

Comments

@zzzhr
Copy link

zzzhr commented Apr 30, 2012

When use ws.ping(),A null pointer error occurred.

@theturtle32
Copy link
Owner

I haven't experienced this problem, but I took the opportunity to add events for ping and pong frames received, and to extend the API to allow you to optionally include a ping payload. Go ahead and try it again.

@zzzhr
Copy link
Author

zzzhr commented May 1, 2012

It still happends.

@zzzhr
Copy link
Author

zzzhr commented May 1, 2012

In WebsocketFrame class,Send() function, if the Frame to send is an ping frame,the 'data' (defined in line168) would not be initized.
My soludion is add this in line 228:
data = new ByteArray();

It works fine:)

@theturtle32
Copy link
Owner

Ah good catch. I was testing after my changes by including a payload to the call to ping(), i.e.:

var data:ByteArray = new ByteArray();
data.writeMultiByte("some data", "utf-8");
websocket.ping(data);

@theturtle32
Copy link
Owner

Just committed the fix and uploaded a new .swc and .air file to the Downloads section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants