Socket

class neko.net.SocketAvailable in nekoSockets are used for networking communication. var custom : DynamicStorage space for anything. var input(default,null) : SocketInputUsed for reading from a connected socket. var output(default,null) : SocketOutputUsed for writing to a connected socket. function new( ?s : SocketHandle ) : VoidCreate a new TCP socket. If s is specified, the new socket object will use the native socket associated with the given handle. function accept() : SocketAccept an incoming connection request. function bind( host : Host, port : Int ) : VoidBind the socket for server usage on the given host and port. function close() : VoidClose a socket. Any subsequent operation on this socket will fail. function connect( host : Host, port : Int ) : VoidConnect the socket the given host and port. function host() : { port : Int, host : Host }Return the socket local address composed of an (host,port) array. function listen( connections : Int ) : VoidListen for a number of connections. function peer() : { port : Int, host : Host }Return the socket connected peer address composed of an (host,port) array. function read() : StringRead the whole content of a the data available from a socket until the connection close. If the socket hasn't been close by the other side, the function might block. function setBlocking( b : Bool ) : VoidTurn on/off the socket blocking mode. function setFastSend( b : Bool ) : Void function setTimeout( timeout : Float ) : VoidSet the socket send and recv timeout in seconds to the given value (or null for blocking). function shutdown( read : Bool, write : Bool ) : VoidPrevent the socket from further reading or writing or both. function waitForRead() : Void function write( content : String ) : VoidSend the whole content of a string over a connected socket. static function newUdpSocket() : SocketCreate a new UDP socket. static function select( read : Array<Socket>, write : Array<Socket>, others : Array<Socket>, timeout : Float ) : { write : Array<Socket>, read : Array<Socket>, others : Array<Socket> }
version #6537, modified 2009-07-26 17:47:20 by api