Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
2bb90c75
Commit
2bb90c75
authored
Mar 11, 2010
by
Srikanth Raju
Committed by
Jean-Philippe André
Mar 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lua: Implement net.connect_tcp
Signed-off-by:
Jean-Philippe André
<
jpeg@videolan.org
>
parent
8f99b241
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
modules/misc/lua/libs/net.c
modules/misc/lua/libs/net.c
+12
-0
No files found.
modules/misc/lua/libs/net.c
View file @
2bb90c75
...
...
@@ -45,6 +45,7 @@
#endif
#include <sys/stat.h>
#include<errno.h>
#include "../vlc.h"
#include "../libs.h"
...
...
@@ -150,6 +151,16 @@ static int vlclua_net_accept( lua_State *L )
/*****************************************************************************
*
*****************************************************************************/
static
int
vlclua_net_connect_tcp
(
lua_State
*
L
)
{
vlc_object_t
*
p_this
=
vlclua_get_this
(
L
);
const
char
*
psz_host
=
luaL_checkstring
(
L
,
1
);
int
i_port
=
luaL_checkint
(
L
,
2
);
int
i_fd
=
net_Connect
(
p_this
,
psz_host
,
i_port
,
SOCK_STREAM
,
IPPROTO_TCP
);
lua_pushinteger
(
L
,
i_fd
);
return
1
;
}
static
int
vlclua_net_close
(
lua_State
*
L
)
{
int
i_fd
=
luaL_checkint
(
L
,
1
);
...
...
@@ -339,6 +350,7 @@ static int vlclua_opendir( lua_State *L )
static
const
luaL_Reg
vlclua_net_reg
[]
=
{
{
"url_parse"
,
vlclua_url_parse
},
{
"listen_tcp"
,
vlclua_net_listen_tcp
},
{
"connect_tcp"
,
vlclua_net_connect_tcp
},
{
"close"
,
vlclua_net_close
},
{
"send"
,
vlclua_net_send
},
{
"recv"
,
vlclua_net_recv
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment