Skip to content
OpenFL Socket abstraction
Latest commit fc5ffcf Mar 25, 2015 @Dvergar Update
Failed to load latest commit information.
sample-game added client-side tests Dec 28, 2013
src/qookie ADDED readBytes/writeBytes (no html target yet) Mar 3, 2014


Note: OpenFL now seems to support the net package, so you should probably just use that :)

Qookie is a socket abstraction for OpenFL in order to reflect the same behaviour as the flash socket library.

It's been unit-tested for android, cpp, neko, flash & html5 targets for basic write/read methods.




get the socket

var socket = new Socket();

add events

socket.addEventListener(SocketEvent.CONNECT, onConnect);
socket.addEventListener(SocketEvent.CLOSE, onClose);
socket.addEventListener(SocketEvent.IO_ERROR, onError);
socket.addEventListener(SocketEvent.SOCKET_DATA, onData);


socket.connect("", 4999);

write to it


flush the datas


Note : flush is generally unreliable because it depends on your system and in the case of haxe the target, so i'm enforcing its use here, every writeX method will actually buffer the data and flush will push it to the socket.

Note2 : Error handling is really basic and not mimicing flash at the moment.

Not implemented yet : writeBytes, readBytes, writeObject, readObject, timeout, bytesPending, objectEncoding

Something went wrong with that request. Please try again.