Comparison

net/server_select.lua @ 6047:4db0403bfc0d

net.server_{select,event}: Add compat code for supporting the same client port API on connections
author Kim Alvefur <zash@zash.se>
date Tue, 01 Apr 2014 15:26:40 +0200
parent 5949:a9abbdeddbf3
child 6054:7a5ddbaf758d
child 6314:8029b8a5f37a
comparison
equal deleted inserted replaced
6046:b7dd7b8165df 6047:4db0403bfc0d
395 return serverport 395 return serverport
396 end 396 end
397 handler.clientport = function( ) 397 handler.clientport = function( )
398 return clientport 398 return clientport
399 end 399 end
400 handler.port = handler.clientport -- COMPAT server_event
400 local write = function( self, data ) 401 local write = function( self, data )
401 bufferlen = bufferlen + #data 402 bufferlen = bufferlen + #data
402 if bufferlen > maxsendlen then 403 if bufferlen > maxsendlen then
403 _closelist[ handler ] = "send buffer exceeded" -- cannot close the client at the moment, have to wait to the end of the cycle 404 _closelist[ handler ] = "send buffer exceeded" -- cannot close the client at the moment, have to wait to the end of the cycle
404 handler.write = idfalse -- dont write anymore 405 handler.write = idfalse -- dont write anymore