Directed presence
[prosody.git] / net / server.lua
index 55afcf3f777d5a90cf863047709ba3de7ca1ba13..4e5ec366c11cf901268d851dd101645707e0a606 100644 (file)
@@ -587,6 +587,8 @@ wraptcpclient = function( listener, socket, ip, serverport, clientport, mode )
 
        local eol, fatal_send_error
 
+       socket:settimeout(0);
+       
        local rstat, sstat = 0, 0
 
        --// local import of socket methods //--
@@ -798,10 +800,6 @@ end
 loop = function( )    -- this is the main loop of the program
        --signal_set( "hub", "run" )
        repeat
-               --[[print(readlen, writelen)
-               for _, s in ipairs(readlist) do print("R:", tostring(s)) end
-               for _, s in ipairs(writelist) do print("W:", tostring(s)) end
-               out_put("select()"..os.time())]]
                local read, write, err = socket_select( readlist, writelist, 1 )    -- 1 sec timeout, nice for timers
                for i, socket in ipairs( write ) do    -- send data waiting in writequeues
                        local handler = socketlist[ socket ]
@@ -837,5 +835,6 @@ return {
        stats = stats,
        closeall = closeall,
        addtimer = addtimer,
+       wraptcpclient = wraptcpclient,
        wraptlsclient = wraptlsclient,
 }