aboutsummaryrefslogtreecommitdiff
path: root/src/socket.h
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2003-06-26 18:47:49 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2003-06-26 18:47:49 +0000
commit71f6bb60bf2b7457091c7106190f92ab7e51f7c6 (patch)
tree8ad3668667bd3da3c34f7ff7ae0a9a7a4daa4679 /src/socket.h
parentf330540576031528f0daac231c61d4dd06e8ba1e (diff)
downloadluasocket-71f6bb60bf2b7457091c7106190f92ab7e51f7c6.tar.gz
luasocket-71f6bb60bf2b7457091c7106190f92ab7e51f7c6.tar.bz2
luasocket-71f6bb60bf2b7457091c7106190f92ab7e51f7c6.zip
Finished implementation of LuaSocket 2.0 alpha on Linux.
Some testing still needed.
Diffstat (limited to 'src/socket.h')
-rw-r--r--src/socket.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/socket.h b/src/socket.h
index 70ebc52..c7db5f2 100644
--- a/src/socket.h
+++ b/src/socket.h
@@ -1,11 +1,16 @@
1#ifndef SOCK_H
2#define SOCK_H
1/*=========================================================================*\ 3/*=========================================================================*\
2* Socket compatibilization module 4* Socket compatibilization module
5* LuaSocket toolkit
6*
7* BSD Sockets and WinSock are similar, but there are a few irritating
8* differences. Also, not all *nix platforms behave the same. This module
9* (and the associated usocket.h and wsocket.h) factor these differences and
10* creates a interface compatible with the io.h module.
3* 11*
4* RCS ID: $Id$ 12* RCS ID: $Id$
5\*=========================================================================*/ 13\*=========================================================================*/
6#ifndef SOCK_H
7#define SOCK_H
8
9#include "io.h" 14#include "io.h"
10 15
11/*=========================================================================*\ 16/*=========================================================================*\
@@ -32,7 +37,6 @@ int sock_accept(p_sock ps, p_sock pa, SA *addr, socklen_t *addr_len,
32const char *sock_connect(p_sock ps, SA *addr, socklen_t addr_len); 37const char *sock_connect(p_sock ps, SA *addr, socklen_t addr_len);
33const char *sock_bind(p_sock ps, SA *addr, socklen_t addr_len); 38const char *sock_bind(p_sock ps, SA *addr, socklen_t addr_len);
34void sock_listen(p_sock ps, int backlog); 39void sock_listen(p_sock ps, int backlog);
35
36int sock_send(p_sock ps, const char *data, size_t count, 40int sock_send(p_sock ps, const char *data, size_t count,
37 size_t *sent, int timeout); 41 size_t *sent, int timeout);
38int sock_recv(p_sock ps, char *data, size_t count, 42int sock_recv(p_sock ps, char *data, size_t count,
@@ -41,11 +45,8 @@ int sock_sendto(p_sock ps, const char *data, size_t count,
41 size_t *sent, SA *addr, socklen_t addr_len, int timeout); 45 size_t *sent, SA *addr, socklen_t addr_len, int timeout);
42int sock_recvfrom(p_sock ps, char *data, size_t count, 46int sock_recvfrom(p_sock ps, char *data, size_t count,
43 size_t *got, SA *addr, socklen_t *addr_len, int timeout); 47 size_t *got, SA *addr, socklen_t *addr_len, int timeout);
44
45void sock_setnonblocking(p_sock ps); 48void sock_setnonblocking(p_sock ps);
46void sock_setblocking(p_sock ps); 49void sock_setblocking(p_sock ps);
47void sock_setreuseaddr(p_sock ps);
48
49const char *sock_hoststrerror(void); 50const char *sock_hoststrerror(void);
50const char *sock_createstrerror(void); 51const char *sock_createstrerror(void);
51const char *sock_bindstrerror(void); 52const char *sock_bindstrerror(void);