[luci] [LuCI] #140: allow unix domain sockets in nixio sendto and recvfrom

LuciTrac trac at luci.subsignal.org
Wed Aug 11 15:29:29 CEST 2010


#140: allow unix domain sockets in nixio sendto and recvfrom
-------------------------+--------------------------------------------------
 Reporter:  reporter     |       Owner:                      
     Type:  enhancement  |      Status:  new                 
 Priority:  major        |   Milestone:  LuCI 0.10.0         
Component:  LuCI Base    |    Keywords:  unix socket recvfrom
-------------------------+--------------------------------------------------
 Please find a patch in attachment that implements the AF_UNIX domain
 socket in the socket:sendto and socket:recvfrom functions. Especially the
 recvfrom is important when using the connectionless DGRAM sockets. For the
 server to be able to reply to an incoming request on a DGRAM socket, it
 needs to determine where the packet originated, in which case the recv or
 read methods will not do.

 Remarks:
 - Even with an unpatched io file, I did not manage to get the sendto to
 work properly with AF_INET domain sockets:
 {{{
 > print(s:sendto('test', '127.0.0.1', 8080))
 nil     22      Invalid argument
 }}}
 - Linux itself apparently does not like the sendto to be used in
 conjunction with unix domain sockets (without being preceded by a connect,
 but then the sendto itself is quite useless):
 {{{
 > print(s:sendto('test', '/var/run/flukso/client.sock', 0))
 nil     134     Transport endpoint is not connected
 }}}
 While this is clearly possible in HP-UX, see:
 http://docs.hp.com/en/B2355-90136/ch07s06.html.

 Best regards,
 Bart Van Der Meerssche.

-- 
Ticket URL: <http://luci.subsignal.org/ticket/140>
LuCI <http://luci.subsignal.org>
LuCI - Lua Configuration Interface


More information about the luci mailing list