package python.lib.socket
extended by SSLSocket
Available on python
A TCP socket class : allow you to both connect to a given server and exchange messages or start your own server and wait for connections.
new()Creates a new unconnected socket.
accept():Tuple2<Socket, Address>Accept a new connected client. This will return a connected socket on which you can read/write some data.
bind(address:Address):VoidBind the socket to the given host/port so it can afterwards listen for connections there.
close():VoidCloses the socket : make sure to properly close all your sockets or you will crash when you run out of file descriptors.
connect(addr:Address):VoidConnect to the given server host/port. Throw an exception in case we couldn't successfully connect.
fileno():Intgetpeername():AddressReturn the information about the other side of a connected socket.
getsockname():AddressReturn the information about our side of a connected socket.
listen(connections:Int):VoidAllow the socket to listen for incoming questions. The parameter tells how many pending connections we can have until they get refused. Use accept() to accept incoming connections.
recv(n:Int, flags:Int):BytesDatasend(d:BytesData, flags:Int):Intsetblocking(b:Bool):VoidChange the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediately by throwing a haxe.io.Error.Blocked value.
setsockopt(family:Int, option:Int, value:Bool):Voidsettimeout(timeout:Float):VoidGives a timeout after which blocking socket operations (such as reading and writing) will abort and throw an exception.
shutdown(how:Int):VoidShutdown the socket, either for reading or writing.
waitForRead():VoidBlock until some data is available for read on the socket.
    © 2005–2020 Haxe Foundation
Licensed under a MIT license.
    https://api.haxe.org/python/lib/socket/Socket.html