|
@@ -54,7 +54,7 @@ class Socket {
|
|
public var output(default,null) : haxe.io.Output;
|
|
public var output(default,null) : haxe.io.Output;
|
|
|
|
|
|
/**
|
|
/**
|
|
- A custom value that can be associated with the socket. Can be used to retreive your custom infos after a `select`.
|
|
|
|
|
|
+ A custom value that can be associated with the socket. Can be used to retrieve your custom infos after a `select`.
|
|
***/
|
|
***/
|
|
public var custom : Dynamic;
|
|
public var custom : Dynamic;
|
|
|
|
|
|
@@ -90,7 +90,7 @@ class Socket {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- Connect to the given server host/port. Throw an exception in case we couldn't sucessfully connect.
|
|
|
|
|
|
+ Connect to the given server host/port. Throw an exception in case we couldn't successfully connect.
|
|
**/
|
|
**/
|
|
public function connect( host : Host, port : Int ) : Void {
|
|
public function connect( host : Host, port : Int ) : Void {
|
|
sock.Connect( host.ipAddress, port );
|
|
sock.Connect( host.ipAddress, port );
|
|
@@ -146,7 +146,7 @@ class Socket {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- Return the informations about the other side of a connected socket.
|
|
|
|
|
|
+ Return the information about the other side of a connected socket.
|
|
**/
|
|
**/
|
|
public function peer() : { host : Host, port : Int } {
|
|
public function peer() : { host : Host, port : Int } {
|
|
var remoteIP = cast(sock.RemoteEndPoint, IPEndPoint);
|
|
var remoteIP = cast(sock.RemoteEndPoint, IPEndPoint);
|
|
@@ -154,7 +154,7 @@ class Socket {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- Return the informations about our side of a connected socket.
|
|
|
|
|
|
+ Return the information about our side of a connected socket.
|
|
**/
|
|
**/
|
|
public function host() : { host : Host, port : Int } {
|
|
public function host() : { host : Host, port : Int } {
|
|
var localIP = cast(sock.LocalEndPoint, IPEndPoint);
|
|
var localIP = cast(sock.LocalEndPoint, IPEndPoint);
|
|
@@ -179,14 +179,14 @@ class Socket {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- Change the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediatly by throwing a haxe.io.Error.Blocking value.
|
|
|
|
|
|
+ Change 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.Blocking value.
|
|
**/
|
|
**/
|
|
public function setBlocking( b : Bool ) : Void {
|
|
public function setBlocking( b : Bool ) : Void {
|
|
sock.Blocking = b;
|
|
sock.Blocking = b;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- Allows the socket to immediatly send the data when written to its output : this will cause less ping but might increase the number of packets / data size, especially when doing a lot of small writes.
|
|
|
|
|
|
+ Allows the socket to immediately send the data when written to its output : this will cause less ping but might increase the number of packets / data size, especially when doing a lot of small writes.
|
|
**/
|
|
**/
|
|
public function setFastSend( b : Bool ) : Void {
|
|
public function setFastSend( b : Bool ) : Void {
|
|
sock.NoDelay = b;
|
|
sock.NoDelay = b;
|