Commit Graph

176 Commits

Author SHA1 Message Date
Diego Nehab
be67f63f4e Changed buffer-per-socket to buffer-per-operation.
This is a difficult tradeoff to measure. I think large
datagrams won't be used very frequently. So it is better to
not lock a large buffer to each socket object and instead
allocate and deallocate for each operation receiving a
datagram larger than UDP_DATAGRAMSIZE.
2015-10-06 11:33:50 +08:00
Diego Nehab
77bba625d7 Fixes suggested by @Florob in #147. 2015-08-25 15:41:40 -03:00
Diego Nehab
96965b179c New agnostic IPv4 IPv6 functions.
Also dealing with EPROTOTYPE Yosemite seems to be throwing
at us for no reason.
2015-08-22 19:52:01 -03:00
Diego Nehab
e75444ccd1 New compat.h module implements luaL_setfuncs.
Makes initialization code simpler everywhere.
2015-08-21 15:39:34 -03:00
Diego Nehab
ddf4292824 Out of the box support for Lua 5.3. 2015-02-18 20:51:37 -02:00
Fabien Fleutot
480a818bf0 support multiple filters in ltn12.{sink,source}.chain() 2013-06-18 11:01:46 +02:00
Diego Nehab
7cad902bb7 Fix makefile and test_socket_error.lua 2013-06-12 21:45:15 +08:00
Diego Nehab
ebde49944b Unix domain tests still broken. 2013-05-30 17:59:28 +08:00
moteus
1de617e355 Add. Allow get error option to socket. 2013-05-29 14:33:27 +04:00
moteus
45ff0e1775 Fix. use table.unpack in mimetest on Lua 5.2. 2013-05-27 13:11:07 +04:00
moteus
920bc97629 Build with Lua 5.2 without LUA_COMPAT_MODULE flag.
LUASOCKET_USE_GLOBAL flag enable create global variables when load socket/mime modules.
2013-05-27 12:45:09 +04:00
moteus
bd51d8c1a5 Fix. Optional IPv6 test 2013-05-27 11:26:35 +04:00
moteus
e54f78c61c Fix. setsockname fails with "*" as host.
Add. test_bind.lua
2013-05-27 11:25:31 +04:00
moteus
56dbda39ed Fix. getaddrinfo returns garbage as address on Windows.
Add. test_getaddrinfo.lua
2013-05-27 11:20:52 +04:00
Diego Nehab
c28fa1d309 Merge pull request #27 from catwell/pull-noarg
fix more uses of arg
2013-04-17 19:38:21 -07:00
Gerardo Marset
56893e9dcd Use the length operator (#) instead of table.getn.
table.getn was deprecated in Lua 5.1 in favor of #, the length operator.
See: http://www.lua.org/manual/5.1/manual.html#7.2
2013-02-25 20:28:28 -02:00
Pierre Chapuis
33b4f0cfc7 remove uses of arg in the codebase 2013-01-23 19:13:32 +01:00
Diego Nehab
6368caeb5a Fix udp:setpeername("*")
There seems to be a curious difference between MacOS and
Linux and I am not sure if this is documented. When you
break a "connection" on Mac OS, you only eliminate the peer
association, but the local address remains bound. On Linux,
breaking a "connection" eliminates the binding to the local
address. Have you guys ever come accross this?

Another irritating difference is that connect() returns the
error EAFNOSUPPORT on Mac OS. I am going to ignore all
errors when the reason for calling connect() is simply to
break the "connection".
2012-08-23 19:31:15 -03:00
Diego Nehab
04be61f88d Test server exits gracefully at command of test client 2012-05-01 16:21:06 +08:00
Florian Zeitz
6de0aa54fd Update method list in tests 2012-04-29 21:03:28 +02:00
Florian Zeitz
cf4d29f86d Select loadstring or load for Lua 5.1/5.2 respectively 2012-04-29 20:46:35 +02:00
Florian Zeitz
46736a3355 Test method registration for IPv6 sockets 2012-04-29 20:44:15 +02:00
Diego Nehab
f960b3872a Making progress toward a release
Documented headers.lua
Update copyright date everywhere
Remove RCSID from files
Move version back to 2.1 rather than 2.1.1
Fixed url package to support ipv6 hosts
Changed "domain" to "family" in tcp and udp structures
Implemented getfamily methods
2012-04-23 00:18:45 +08:00
Sam Roberts
4b671f4551 Merge branch 'git-sam' into diego-sam-mwild-integration
Conflicts in options.c were just due to independent small functions
being close to each other.

unix.c in mwild was broken, it wasn't using LUASOCKET_API.

serial.c needed luaL_reg renamed, and to use LUASOCKET_API.

makefile didn't respect standard DESTDIR and prefix makefile
variables, and didn't allow LUAV variable to select lua version to build
against.

I've tested the top-level install-both target builds and installs
against both lua5.1 and lua5.2, but not done further testing.

Conflicts:
	README
	config
	gem/ltn012.tex
	makefile
	src/makefile
	src/options.c
	src/options.h
	src/tcp.c
	src/usocket.c
2012-04-11 14:18:20 -07:00
Sam Roberts
195b2a74bb On failure, exit with a message instead of blocking indefinitely. 2012-04-11 13:54:01 -07:00
Sam Roberts
8bb542baaf Support getoption method for tcp objects. 2012-04-11 13:54:01 -07:00
Sam Roberts
3b19f2a7ed testsrvr asserts when test finishes successfully.
When the test client finishes, the test server asserts with a "closed" message.
After looking carefully at this, I think the tests are running
successfully and passing. Since it appears to be a test failure, I
modified the server to allow the client to close the control connection.
2012-04-11 13:45:59 -07:00
Sam Roberts
dace50628c Utility to find how many TCP connections can be made. 2012-04-11 13:45:59 -07:00
Sam Roberts
c37f71d062 Test showing failure to receive a zero-length packet. 2012-04-11 13:45:59 -07:00
Sam Roberts
51acb54760 Stop returning an error after successful send of zero length UDP packets
A zero-length send is invalid with TCP, but well defined with UDP.
udp:send"" was returning (nil,"refused"), indicating that it failed when
the packet was actually sent. The test script reproduces the bug, and
includes a tcpdump of the zero length packet being sent.
2012-04-11 13:45:59 -07:00
Liam Devine
9a58252528 change localhost to loopback ip to prevent error on my mac box???? 2012-04-11 13:33:34 -07:00
Liam Devine
e15ed19db6 Compiles with Lua 5.1.4 and Lua 5.2.0-beta, although the makefile needs sorting out to take maybe a version number and also the local paths need removing. 2012-04-11 13:33:34 -07:00
Diego Nehab
3a8ba90dfb Saving before big changes to support IPv6. 2011-05-25 20:57:22 +00:00
Diego Nehab
bce60be30f Decent makefiles! 2009-05-27 09:31:38 +00:00
Diego Nehab
c893c7abfb Removed os.exit from test. 2007-06-11 23:52:48 +00:00
Diego Nehab
3cd10f5ab6 Crashy bug fixed in recvraw.
Also fixed returns on closed socket.
2007-06-11 23:44:54 +00:00
Diego Nehab
37f266ceea Added simple unix tests. 2007-04-09 22:04:13 +00:00
Diego Nehab
be2e467929 Couple bug fixes. 2007-03-12 04:08:40 +00:00
Diego Nehab
11282d17c8 Almost done 2.0.1. 2006-04-03 04:45:42 +00:00
Diego Nehab
e9d477aba3 Final patches... 2006-04-03 03:10:56 +00:00
Diego Nehab
7121359526 Better image to test mail. 2006-04-02 23:24:37 +00:00
Diego Nehab
93806208c7 Updates for 2.0.1 on the way. 2006-03-19 21:22:21 +00:00
Diego Nehab
5e09779c7f In pre release mode! 2005-11-20 08:56:19 +00:00
Diego Nehab
f20f4889bf Changed prefix of function names to match module names.
Removed some warnings and useless code.
2005-11-20 07:20:26 +00:00
Diego Nehab
f4dadea763 Before compiling on Windows. 2005-10-07 04:40:59 +00:00
Diego Nehab
a65c599fc5 Test back to localhost. 2005-09-29 22:32:33 +00:00
Diego Nehab
8420541720 Tested on Windows. 2005-09-29 22:26:35 +00:00
Diego Nehab
a32c6d9140 Almost ready to release. 2005-09-29 06:11:42 +00:00
Diego Nehab
773e35ced3 Compiled on Windows. Fixed a bunch of stuff. Almost ready to release.
Implemented a nice dispatcher! Non-blocking check-links and forward server
use the dispatcher.
2005-08-23 05:53:14 +00:00
Diego Nehab
0c3cdd5ef2 Final push for release... 2005-08-12 05:56:32 +00:00