Simon Krajewski 11 years ago
parent
commit
e4b1026646
3 changed files with 27 additions and 27 deletions
  1. 10 10
      std/python/_std/sys/net/Socket.hx
  2. 3 3
      std/python/lib/Types.hx
  3. 14 14
      std/python/lib/net/Socket.hx

+ 10 - 10
std/python/_std/sys/net/Socket.hx

@@ -30,13 +30,13 @@ import python.lib.net.Socket.Select in Select;
 import python.lib.net.Address in PAddress;
 import python.lib.net.Address in PAddress;
 
 
 private class SocketInput extends haxe.io.Input {
 private class SocketInput extends haxe.io.Input {
-    
+
     var __s : PSocket;
     var __s : PSocket;
 
 
     public function new(s) {
     public function new(s) {
         __s = s;
         __s = s;
     }
     }
-    
+
     public override function readByte() : Int {
     public override function readByte() : Int {
         var r:BytesData;
         var r:BytesData;
         try {
         try {
@@ -69,11 +69,11 @@ private class SocketInput extends haxe.io.Input {
         super.close();
         super.close();
         if( __s != null ) __s.close();
         if( __s != null ) __s.close();
     }
     }
-    
+
 }
 }
 
 
 private class SocketOutput extends haxe.io.Output {
 private class SocketOutput extends haxe.io.Output {
-    
+
     var __s : PSocket;
     var __s : PSocket;
 
 
     public function new(s) {
     public function new(s) {
@@ -110,7 +110,7 @@ private class SocketOutput extends haxe.io.Output {
 **/
 **/
 @:coreApi class Socket {
 @:coreApi class Socket {
 
 
-    
+
     var __s:PSocket;
     var __s:PSocket;
     /**
     /**
         The stream on which you can read available data. By default the stream is blocking until the requested data is available,
         The stream on which you can read available data. By default the stream is blocking until the requested data is available,
@@ -136,7 +136,7 @@ private class SocketOutput extends haxe.io.Output {
         //input = new SocketInput(__s);
         //input = new SocketInput(__s);
         //output = new SocketOutput(__s);
         //output = new SocketOutput(__s);
     }
     }
-    
+
     function __init() : Void  {
     function __init() : Void  {
         __s = new PSocket();
         __s = new PSocket();
         input = new SocketInput(__s);
         input = new SocketInput(__s);
@@ -161,7 +161,7 @@ private class SocketOutput extends haxe.io.Output {
         Write the whole data to the socket output.
         Write the whole data to the socket output.
     **/
     **/
     public function write( content : String ) : Void {
     public function write( content : String ) : Void {
-        
+
     }
     }
 
 
     /**
     /**
@@ -183,7 +183,7 @@ private class SocketOutput extends haxe.io.Output {
     /**
     /**
         Shutdown the socket, either for reading or writing.
         Shutdown the socket, either for reading or writing.
     **/
     **/
-    public function shutdown( read : Bool, write : Bool ) : Void 
+    public function shutdown( read : Bool, write : Bool ) : Void
         __s.shutdown( (read && write) ? PSocket.SHUT_RDWR : read ?  PSocket.SHUT_RD : PSocket.SHUT_WR  );
         __s.shutdown( (read && write) ? PSocket.SHUT_RDWR : read ?  PSocket.SHUT_RD : PSocket.SHUT_WR  );
 
 
     /**
     /**
@@ -234,7 +234,7 @@ private class SocketOutput extends haxe.io.Output {
         Block until some data is available for read on the socket.
         Block until some data is available for read on the socket.
     **/
     **/
     public function waitForRead() : Void {
     public function waitForRead() : Void {
-        
+
     }
     }
 
 
     /**
     /**
@@ -250,7 +250,7 @@ private class SocketOutput extends haxe.io.Output {
     public function setFastSend( b : Bool ) : Void {}
     public function setFastSend( b : Bool ) : Void {}
 
 
     @:keep function fileno():Int return __s.fileno();
     @:keep function fileno():Int return __s.fileno();
-    
+
     /**
     /**
         Wait until one of the sockets groups is ready for the given operation :
         Wait until one of the sockets groups is ready for the given operation :
         [read] contains sockets on which we want to wait for available data to be read,
         [read] contains sockets on which we want to wait for available data to be read,

+ 3 - 3
std/python/lib/Types.hx

@@ -34,13 +34,13 @@ extern class ByteArray implements ArrayAccess<Int> {
 	public inline function get(i:Int):Int {
 	public inline function get(i:Int):Int {
 		return python.Syntax.arrayAccess(this, i);
 		return python.Syntax.arrayAccess(this, i);
 	}
 	}
-	
+
 	public inline function set(i:Int,v:Int):Void {
 	public inline function set(i:Int,v:Int):Void {
         this.__setitem__(i,v);
         this.__setitem__(i,v);
     }
     }
-    
+
     public function __setitem__(i:Int,v:Int):Void;
     public function __setitem__(i:Int,v:Int):Void;
-    
+
 	public function decode(encoding:String="utf-8", errors:String="strict"):String;
 	public function decode(encoding:String="utf-8", errors:String="strict"):String;
 }
 }
 
 

+ 14 - 14
std/python/lib/net/Socket.hx

@@ -34,23 +34,23 @@ typedef Selectable = {
 
 
 @:native("select")
 @:native("select")
 extern class Select {
 extern class Select {
-    
+
     static function __init__ ():Void
     static function __init__ ():Void
     {
     {
         Syntax.importModule("select");
         Syntax.importModule("select");
     }
     }
-    
+
     static function select<T>(reads:Array<T>,writes:Array<T>,xs:Array<T>,timeout:Float):Tup3<Array<T>,Array<T>,Array<T>>;
     static function select<T>(reads:Array<T>,writes:Array<T>,xs:Array<T>,timeout:Float):Tup3<Array<T>,Array<T>,Array<T>>;
-    
+
 }
 }
 
 
 extern class Socket {
 extern class Socket {
-    
+
     static function __init__ ():Void
     static function __init__ ():Void
     {
     {
         Syntax.importFromAs("socket", "socket", "python.lib.net.Socket");
         Syntax.importFromAs("socket", "socket", "python.lib.net.Socket");
     }
     }
-    
+
     static var AF_APPLETALK:Int;
     static var AF_APPLETALK:Int;
     static var AF_ASH:Int;
     static var AF_ASH:Int;
     static var AF_ATMPVC:Int;
     static var AF_ATMPVC:Int;
@@ -312,12 +312,12 @@ extern class Socket {
     static var TIPC_WITHDRAWN:Int;
     static var TIPC_WITHDRAWN:Int;
     static var TIPC_ZONE_SCOPE:Int;
     static var TIPC_ZONE_SCOPE:Int;
     static var _GLOBAL_DEFAULT_TIMEOUT:Int;
     static var _GLOBAL_DEFAULT_TIMEOUT:Int;
-    
+
     function send(d:BytesData,flags:Int):Int;
     function send(d:BytesData,flags:Int):Int;
     function recv(n:Int,flags:Int):BytesData;
     function recv(n:Int,flags:Int):BytesData;
-    
-    
-    
+
+
+
     /**
     /**
         Creates a new unconnected socket.
         Creates a new unconnected socket.
     **/
     **/
@@ -333,8 +333,8 @@ extern class Socket {
     **/
     **/
     function connect( addr : python.lib.net.Address ) : Void;
     function connect( addr : python.lib.net.Address ) : Void;
 
 
-    //function create_connection() : 
-    
+    //function create_connection() :
+
     /**
     /**
         Allow 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.
         Allow 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.
     **/
     **/
@@ -381,13 +381,13 @@ extern class Socket {
     function setblocking( b : Bool ) : Void;
     function setblocking( b : Bool ) : Void;
 
 
     /**
     /**
-        
+
     **/
     **/
     function setsockopt( family:Int, option:Int, value : Bool ) : Void;
     function setsockopt( family:Int, option:Int, value : Bool ) : Void;
 
 
-    
+
     function fileno():Int;
     function fileno():Int;
-    
+
     /**
     /**
         Wait until one of the sockets groups is ready for the given operation :
         Wait until one of the sockets groups is ready for the given operation :
         [read] contains sockets on which we want to wait for available data to be read,
         [read] contains sockets on which we want to wait for available data to be read,