mirror of
https://github.com/ctruLua/ctruLua.git
synced 2025-10-28 00:39:30 +00:00
Added a way to communicate easily between threads. The API _will_ change and be unified.
Also fixed the icon in the example.
This commit is contained in:
parent
3255f2ad74
commit
d3ea68f3d7
4 changed files with 257 additions and 6 deletions
|
|
@ -130,6 +130,8 @@ static int socket_tcp(lua_State *L) {
|
|||
userdata->isSSL = false;
|
||||
fcntl(userdata->socket, F_SETFL, fcntl(userdata->socket, F_GETFL, 0)|O_NONBLOCK);
|
||||
|
||||
SOCU_AddGlobalSocket(userdata->socket);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -155,6 +157,8 @@ static int socket_udp(lua_State *L) {
|
|||
userdata->addr.sin_family = AF_INET;
|
||||
fcntl(userdata->socket, F_SETFL, fcntl(userdata->socket, F_GETFL, 0)|O_NONBLOCK);
|
||||
|
||||
SOCU_AddGlobalSocket(userdata->socket);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue