Commit Graph

79 Commits

Author SHA1 Message Date
f741a88b80 feat(tcp): Add 'bindtodevice' option (#408) 2023-10-23 21:27:01 +03:00
d1ad8160cb feat(tcp): Add support for TCP Defer Accept
This makes it so that a listening socket does not become readable for
accept() until a connection has been fully established *and* started
sending something, thus the program doesn't have to wait for the first
data. This only makes sense for client-speaks-first protocols.

Co-authored-by: Caleb Maclennan <caleb@alerque.com>
2022-07-27 09:40:18 +03:00
0c7df119c2 feat(tcp): Add support for TCP Fast Open 2022-07-27 09:16:43 +03:00
86e1b3f45f tcp: pragma visibility 2019-03-10 00:04:20 -07:00
525d703e16 tcp.c: use LUASOCKET_PRIVATE 2019-02-25 16:00:51 -07:00
a9c75cb099 Merge pull request #244 from leyyer/options
add options:
2019-02-24 17:57:23 -03:00
699c36c019 Merge pull request #116 from linuxmaniac/master
Add "tcp-keepidle", "tcp-keepcnt" and "tcp-keepintvl" options
2019-02-24 17:55:27 -03:00
97bfe1e043 add options:
get/set : recv-buffer-size
get/set : send-buffer-size

Signed-off-by: surenyi <surenyi82@163.com>
2018-03-25 14:58:10 +08:00
944305dc21 Added gettimeout for completeness.
Also documented.
Rordered manuals so order is alphabetical.
2016-03-04 15:36:32 -03:00
83880dbed7 When zero-timeout, only try first address in connect. 2015-12-03 12:56:18 -02:00
f4b4720073 Merge branch 'tcp_reuseport' of https://github.com/KateAdams/luasocket into KateAdams-tcp_reuseport 2015-10-05 10:28:29 +08:00
77bba625d7 Fixes suggested by @Florob in #147. 2015-08-25 15:41:40 -03:00
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
e75444ccd1 New compat.h module implements luaL_setfuncs.
Makes initialization code simpler everywhere.
2015-08-21 15:39:34 -03:00
2906d6a522 Add "tcp-keepidle", "tcp-keepcnt" and "tcp-keepintvl" options 2014-12-05 13:17:50 +01:00
833333e131 Added ability to set the option reuseport of a tcp socket. 2013-09-12 00:46:32 +01:00
1de617e355 Add. Allow get error option to socket. 2013-05-29 14:33:27 +04:00
79e6c4915d Export global only if LUA_COMPAT_MODULE defined. 2013-05-29 16:56:56 +08:00
e54f78c61c Fix. setsockname fails with "*" as host.
Add. test_bind.lua
2013-05-27 11:25:31 +04:00
427220c7b1 Merge tryconnect6 into inet_tryconnect. 2013-05-26 21:26:26 +08:00
6d93fd7c8f Fix socket.connect
Previous implementation was not making sure the socket
had the same family as the addr returned by getaddrinfo.
So instead of "connection refused", we could get "invalid
argument", which was our fault.
2013-05-26 15:18:13 +08:00
72a5347f97 Remove warnings and fix makefile for Win32. 2012-12-11 17:43:49 -02:00
618ce43ee3 Fix socket_accept usage to depend on family. 2012-12-11 16:35:27 -02:00
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
d777341eaf tcp: Initialize clnt->family in :accept()
Also unconditionally zero out the structs when allocated, for
good measure.
2012-05-21 19:44:08 -07:00
156669c28b socket.connect now implemented in the C core
This avoid socket.lua duplicating the iteration over the results
of getaddrinfo(). Some problems with the C implementation not
initializing sockets or the luasocket family have also been fixed,
and error reporting made more robust.
2012-05-10 14:14:22 -07:00
e86eac96fa :shutdown() errors on all invalid argument strings
It used to error only on invalid argument strings that started with 's',
'r', or 'b'.
2012-04-26 16:50:27 -07:00
c2e29537f5 Fixed getpeername/getsockname situation
- Added IPv6 support to getsockname
- Simplified getpeername implementation
- Added family to return of getsockname and getpeername
and added modification to the manual to describe
2012-04-24 00:47:30 +08:00
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
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
8bb542baaf Support getoption method for tcp objects. 2012-04-11 13:54:01 -07:00
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
594f826aa1 Add support for connecting to IPv6 hosts 2012-04-11 13:33:34 -07:00
f871a29f27 Add support for the IPV6_V6ONLY socket option defaulting to on. 2012-04-11 13:33:34 -07:00
923eef1929 Rework binding IPv6 sockets by harmonizing it with the IPv4 variant 2012-04-11 13:33:34 -07:00
908ee2cce1 Fix two crashes and add -Wshadow so that this can't happen again.
The two crashes are the s/const char *// changes in tcp.c.  The rest
is cleanup so it will build.
2012-04-11 13:33:34 -07:00
2778766d67 Preliminary IPv6 support for v2.1 2012-04-11 13:25:11 -07:00
bce60be30f Decent makefiles! 2009-05-27 09:31:38 +00:00
f4dadea763 Before compiling on Windows. 2005-10-07 04:40:59 +00:00
a32c6d9140 Almost ready to release. 2005-09-29 06:11:42 +00:00
9596c7f95d Bug in forward.lua. Wasn't breaking from the loop. 2005-04-21 05:38:07 +00:00
434e8e014c Better connection handling. 2005-04-21 03:15:34 +00:00
2a00a5ad50 Trying to get non-blocking connect to work. 2005-04-20 18:57:47 +00:00
6dc9c1096a Seems to be working on windows. 2005-03-11 02:21:27 +00:00
e57f9e9964 Apparently, non-blocking connect doesn't work on windows if you use 0
timeout in the select call...
2005-03-11 00:20:21 +00:00
7350bad6f4 Just to check out in the office. 2005-02-27 18:30:32 +00:00
8d4e240f6a Forward server working on Mac OS X... 2005-02-08 10:01:01 +00:00
2cd2a5d4a4 Stupid bug. 2005-01-22 22:38:43 +00:00
7c97e8e40a Almost ready for beta3 2004-11-27 07:58:04 +00:00
cd994f306a Gonna try my luck on windows... 2004-07-26 04:03:55 +00:00