Author: vlendec Date: 2005-09-30 21:36:59 +0000 (Fri, 30 Sep 2005) New Revision: 10661
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10661 Log: Next round of messages.c. Now I start to be like it, the client is quite simple. General idea: Every messaging client has a unix datagram socket open in lock_path("messaging") where it sends and receives direct messages from. It also connects to a unix stream socket in the same directory that a dispatch daemon listens on. Anybody interested (Jeremy?) might look at message_send_pid and message_dispatch, they have become really simple. message_send_pid() tries to directly send non-blocking and falls back to a blocking write to the stream socket if the non-blocking call would fail for any reason. One source of complexity is safe startup of the dispatch daemon. The first one to do a message_init() tries to connect to the socket. If that fails, we can't directly unlink() and bind() to establish that, as this would open us for races. Thus I'm protecting that by an exclusive fcntl lock on the pid file that is created. Volker Modified: branches/tmp/vl-cluster/source/include/messages.h branches/tmp/vl-cluster/source/lib/messages.c branches/tmp/vl-cluster/source/lib/util.c branches/tmp/vl-cluster/source/smbd/server.c Changeset: Sorry, the patch is too large (802 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10661
