aboutsummaryrefslogtreecommitdiff
path: root/src/udp.h
diff options
context:
space:
mode:
authorDiego Nehab <diego.nehab@gmail.com>2015-10-06 11:33:50 +0800
committerDiego Nehab <diego.nehab@gmail.com>2015-10-06 11:33:50 +0800
commitbe67f63f4e11e53690bf1431a236f86b484c9bf0 (patch)
tree2a9e3de162711f3453d238eb49155c4c488189ec /src/udp.h
parentfd729b32a8966291f007567f72f3dc0158bdab35 (diff)
downloadluasocket-be67f63f4e11e53690bf1431a236f86b484c9bf0.tar.gz
luasocket-be67f63f4e11e53690bf1431a236f86b484c9bf0.tar.bz2
luasocket-be67f63f4e11e53690bf1431a236f86b484c9bf0.zip
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.
Diffstat (limited to 'src/udp.h')
-rw-r--r--src/udp.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/udp.h b/src/udp.h
index da27a7a..be9b6a5 100644
--- a/src/udp.h
+++ b/src/udp.h
@@ -23,8 +23,6 @@ typedef struct t_udp_ {
23 t_socket sock; 23 t_socket sock;
24 t_timeout tm; 24 t_timeout tm;
25 int family; 25 int family;
26 size_t len; /* length of datagram buffer below */
27 char buf[1]; /* allocate larger structure to hold actual buffer */
28} t_udp; 26} t_udp;
29typedef t_udp *p_udp; 27typedef t_udp *p_udp;
30 28