Changeset

2112:8d70ca2d4f9e

net.server_event: Define id property for connection objects, to aid logging
author Matthew Wild <mwild1@gmail.com>
date Sun, 22 Nov 2009 03:20:35 +0000
parents 2111:f59d9738437e
children 2113:cbf7241a0f6a
files net/server_event.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_event.lua	Sun Nov 22 03:14:32 2009 +0000
+++ b/net/server_event.lua	Sun Nov 22 03:20:35 2009 +0000
@@ -444,6 +444,7 @@
 			_sslctx = sslctx; -- parameters
 			_usingssl = false;  -- client is using ssl;
 		}
+		interface.id = tostring(interface):match("%x+$");
 		interface.writecallback = function( event )  -- called on write events
 			--vdebug( "new client write event, id/ip/port:", interface, ip, port )
 			if interface.nowriting or ( interface.fatalerror and ( "client to close" ~= interface.fatalerror ) ) then  -- leave this event
@@ -592,6 +593,7 @@
 			fatalerror = false; -- error message
 			nointerface = true;  -- lock/unlock parameter
 		}
+		interface.id = tostring(interface):match("%x+$");
 		interface.readcallback = function( event )  -- server handler, called on incoming connections
 			--vdebug( "server can accept, id/addr/port:", interface, addr, port )
 			if interface.fatalerror then