PageRenderTime 5ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/titanium/mobile/network/Socket.hx

http://github.com/visup/haxe-titanium-api
Haxe | 64 lines | 15 code | 5 blank | 44 comment | 0 complexity | 827dd2eded6982f6f9c038186f3fa0c3 MD5 | raw file
 1package titanium.mobile.network;
 2
 3import titanium.mobile.core.Dispatcher;
 4import titanium.mobile.core.Buffer;
 5import titanium.mobile.IOStream;
 6import titanium.mobile.network.socket.TCP;
 7
 8/**
 9Socket class
10
11Documentation available at:
12http://developer.appcelerator.com/apidoc/mobile/1.7.0.RC1/Titanium.Network.Socket-module
13
14- namespace
15
16Titanium.Network.Socket
17
18- type
19
20module
21
22- description
23
24Socket module
25
26- since
27
281.7
29
30- platforms
31
32iphone, android, ipad
33
34- properties
35
36INITIALIZED[Number]: state representing the initialized state of a socket
37CONNECTED[Number]: state representing the connected state of a socket
38LISTENING[Number]: state representing the listening state of a socket
39CLOSED[Number]: state representing the closed state of a socket
40ERROR[Number]: state representing the error state of a socket
41
42- methods
43
44createTCP: returns new TCP socket object, takes object containing properties list defined in `Titanium.Network.Socket.TCP`.  Some properties are only needed based on whether the socket will be a connecting socket or a listening socket.
45
46- method : createTCP, `Titanium.Network.Socket.TCP`
47params[Object]: creation parameters
48
49**/
50
51
52@:native("Titanium.Network.Socket")
53extern class Socket extends Dispatcher, implements IOStream
54{
55	// static methods
56	public static function createTCP(params:Dynamic):TCP;
57	
58	// implemented methods
59	public function read( buffer:Buffer, ?offset:Int, ?length:Int ):Int;
60	public function write( buffer:Buffer, ?offset:Int, ?length:Int ):Int;
61	public function isWriteable():Bool;
62	public function isReadable():Bool;
63	public function close():Void;	
64}