Commits

Vincent Chinedu Okonkwo  committed 8516c78

make it easy to override methods without import stream modules

  • Participants
  • Parent commits bc7b510

Comments (0)

Files changed (2)

File hxuv/net/remoting/AsyncRemotingServer.hx

 
 private typedef RClientInfo = {
   var client : AsyncSocketConnection;
-  var sock : StreamInterface;
+  var sock : AsyncSocket;
   var buf : haxe.io.Bytes;
   var bufpos : Int;
 }
 		this.domains = domains;
 	}
 
-    function onClientClosed(s:StreamInterface) {
+    function onClientClosed(s:AsyncSocket) {
       this.clients.remove(s.custom);
     }
 
       onError(e, haxe.Stack.exceptionStack());
 	}
 
-    function onClientDataReady(sock : StreamInterface, data:String) {
+    function onClientDataReady(sock : AsyncSocket, data:String) {
 
       var c:RClientInfo = sock.custom;
 
       c.bufpos = len;
     }
 
-	function addClient( sock : StreamInterface ) {
+	function addClient( sock : AsyncSocket ) {
       var infos : RClientInfo = {
           client : clientConnected(sock),
           sock : sock,
 		init();
 	}
 
-	public function sendData( s : hxuv.Stream.StreamInterface, data : String ) {
+	public function sendData( s : AsyncSocket, data : String ) {
 		try {
 			s.send(data);
 		} catch( e : Dynamic ) {
 		}
 	}
 
-	public function stopClient( s : StreamInterface ) {
+	public function stopClient( s : AsyncSocket ) {
 		var infos : RClientInfo = s.custom;
         clients.remove(infos);
         s.custom = null;
 	}
 
 
-	public function clientConnected( s : StreamInterface ) {
+	public function clientConnected( s : AsyncSocket ) {
 		var ctx = new haxe.remoting.Context();
 		var cnx = AsyncSocketConnection.create(s,ctx);
 		var me = this;

File hxuv/net/remoting/AsyncSocketConnection.hx

 import haxe.remoting.AsyncConnection;
 import haxe.remoting.Context;
 
+typedef AsyncSocket = StreamInterface;
+
 class AsyncSocketConnection implements AsyncConnection, implements Dynamic<AsyncConnection> {
 
 	var __path : Array<String>;
 		__data.error(header + estr);
 	}
 
-	public static function create( s : StreamInterface, ?ctx : Context ) {
+	public static function create( s : AsyncSocket, ?ctx : Context ) {
 		var data = {
 			protocol : new AsyncSocketProtocol(s, ctx),
 			results : new List(),