Socket.hx 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package flash.net;
  2. extern class Socket extends flash.events.EventDispatcher implements flash.utils.IDataOutput implements flash.utils.IDataInput {
  3. @:flash.property var bytesAvailable(get,never) : UInt;
  4. @:flash.property @:require(flash11) var bytesPending(get,never) : UInt;
  5. @:flash.property var connected(get,never) : Bool;
  6. @:flash.property var endian(get,set) : flash.utils.Endian;
  7. @:flash.property var objectEncoding(get,set) : UInt;
  8. @:flash.property @:require(flash10) var timeout(get,set) : UInt;
  9. function new(?host : String, port : Int = 0) : Void;
  10. function close() : Void;
  11. function connect(host : String, port : Int) : Void;
  12. function flush() : Void;
  13. private function get_bytesAvailable() : UInt;
  14. private function get_bytesPending() : UInt;
  15. private function get_connected() : Bool;
  16. private function get_endian() : flash.utils.Endian;
  17. private function get_objectEncoding() : UInt;
  18. private function get_timeout() : UInt;
  19. function readBoolean() : Bool;
  20. function readByte() : Int;
  21. function readBytes(bytes : flash.utils.ByteArray, offset : UInt = 0, length : UInt = 0) : Void;
  22. function readDouble() : Float;
  23. function readFloat() : Float;
  24. function readInt() : Int;
  25. function readMultiByte(length : UInt, charSet : String) : String;
  26. function readObject() : Dynamic;
  27. function readShort() : Int;
  28. function readUTF() : String;
  29. function readUTFBytes(length : UInt) : String;
  30. function readUnsignedByte() : UInt;
  31. function readUnsignedInt() : UInt;
  32. function readUnsignedShort() : UInt;
  33. private function set_endian(value : flash.utils.Endian) : flash.utils.Endian;
  34. private function set_objectEncoding(value : UInt) : UInt;
  35. private function set_timeout(value : UInt) : UInt;
  36. function writeBoolean(value : Bool) : Void;
  37. function writeByte(value : Int) : Void;
  38. function writeBytes(bytes : flash.utils.ByteArray, offset : UInt = 0, length : UInt = 0) : Void;
  39. function writeDouble(value : Float) : Void;
  40. function writeFloat(value : Float) : Void;
  41. function writeInt(value : Int) : Void;
  42. function writeMultiByte(value : String, charSet : String) : Void;
  43. function writeObject(object : Dynamic) : Void;
  44. function writeShort(value : Int) : Void;
  45. function writeUTF(value : String) : Void;
  46. function writeUTFBytes(value : String) : Void;
  47. function writeUnsignedInt(value : UInt) : Void;
  48. }