Ver código fonte

[python] add Socket.read and Socket.write (closes #3325)

Dan Korostelev 11 anos atrás
pai
commit
c2c5e1fd9d
1 arquivos alterados com 2 adições e 5 exclusões
  1. 2 5
      std/python/_std/sys/net/Socket.hx

+ 2 - 5
std/python/_std/sys/net/Socket.hx

@@ -133,9 +133,6 @@ private class SocketOutput extends haxe.io.Output {
         Creates a new unconnected socket.
     **/
     public function new() : Void {
-        //var __s = new PSocket();
-        //input = new SocketInput(__s);
-        //output = new SocketOutput(__s);
     }
 
     function __init() : Void  {
@@ -155,14 +152,14 @@ private class SocketOutput extends haxe.io.Output {
         Read the whole data available on the socket.
     **/
     public function read() : String {
-        return "";
+        return input.readAll().toString();
     }
 
     /**
         Write the whole data to the socket output.
     **/
     public function write( content : String ) : Void {
-
+        output.writeString(content);
     }
 
     /**