lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


hi,

i connected the unix-domain code in luasocket-2.0.2 to the makefile[1],
and i can build and require it, but i cannot find any documentation on
using it.  where can i find a writeup on using AF_UNIX sockets with
luasocket?  i need to send strings to a spam-filter listening on some
socket, but i don't want any TCP overhead.

regards, clemens

[1] on freebsd-8 (CURRENT):
/src/localcode/lua/luasocket-2.0.2
0  # hg diff
diff --git a/config b/config
--- a/config
+++ b/config
@@ -51,7 +51,7 @@
 # Compiler and linker settings
 # for Linux
 CC=gcc
-DEF=-DLUASOCKET_DEBUG
+DEF=-DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN
 CFLAGS= $(LUAINC) $(DEF) -pedantic -Wall -O2 -fpic
 LDFLAGS=-O -shared -fpic
 LD=gcc
diff --git a/makefile b/makefile
--- a/makefile
+++ b/makefile
@@ -10,6 +10,8 @@
 INSTALL_SOCKET_LIB=$(INSTALL_TOP_LIB)/socket
 INSTALL_MIME_SHARE=$(INSTALL_TOP_SHARE)/mime
 INSTALL_MIME_LIB=$(INSTALL_TOP_LIB)/mime
+#
+INSTALL_UNIX_LIB=$(INSTALL_SOCKET_LIB)

 all clean:
        cd src; $(MAKE) $@
@@ -45,6 +47,8 @@
        #cd src; $(INSTALL_DATA) $(TO_MIME_SHARE) $(INSTALL_MIME_SHARE)
        cd src; mkdir -p $(INSTALL_MIME_LIB)
        cd src; $(INSTALL_EXEC) $(MIME_SO) $(INSTALL_MIME_LIB)/core.$(EXT)
+       cd src; mkdir -p $(INSTALL_UNIX_LIB)
+       cd src; $(INSTALL_EXEC) $(UNIX_SO) $(INSTALL_UNIX_LIB)/$(UNIX_SO)

 #------
 # End of makefile
diff --git a/src/makefile b/src/makefile
--- a/src/makefile
+++ b/src/makefile
@@ -47,7 +47,7 @@
        usocket.o \
        unix.o

-all: $(SOCKET_SO) $(MIME_SO)
+all: $(SOCKET_SO) $(MIME_SO) ${UNIX_SO}

 $(SOCKET_SO): $(SOCKET_OBJS)
        $(LD) $(LDFLAGS) -o $@ $(SOCKET_OBJS)