Difference between revisions of "socket"
m (→Reference Manual: The website is sometimes down. Better have a backup link.) |
m |
||
(One intermediate revision by one other user not shown) | |||
Line 5: | Line 5: | ||
local socket = require("socket") | local socket = require("socket") | ||
</source> | </source> | ||
− | |||
− | |||
== Notes == | == Notes == | ||
− | + | * Prior to [[11.0]], LÖVE doesn't fully supports non-blocking TCP connections on Windows | |
− | Starting with LÖVE 11.0, <code>require("socket")</code> no longer creates a global variable. | + | * Starting with LÖVE 11.0, <code>require("socket")</code> no longer creates a global variable. |
− | + | * When using blocking operations (network connect/read/write, or socket.sleep), the whole LÖVE main loop will be blocked, and it is usually a bad idea. So use only non-blocking operations if possible, or use it in a [[love.thread|thread]]. | |
− | |||
− | When using blocking operations (network connect/read/write, or socket.sleep), the whole LÖVE main loop will be blocked, and it is usually a bad idea. So use only non-blocking operations if possible, or use it in a thread. | ||
== Reference Manual == | == Reference Manual == | ||
Line 24: | Line 20: | ||
* [https://github.com/bartbes/love-misc-libs/blob/master/grease/docs.md grease] | * [https://github.com/bartbes/love-misc-libs/blob/master/grease/docs.md grease] | ||
[[Category:Libraries]] | [[Category:Libraries]] | ||
+ | [[Category:ThirdParty]] | ||
{{#set:Description=Module for HTTP, TCP, and UDP networking.}} | {{#set:Description=Module for HTTP, TCP, and UDP networking.}} | ||
{{#set:LOVE Version=0.5.0}} | {{#set:LOVE Version=0.5.0}} |
Latest revision as of 03:04, 5 July 2023
Available since LÖVE 0.5.0 |
This module is not supported in earlier versions. |
Implements a luasocket module for TCP/UDP networking. The luasocket module is bundled with love binary, but in order to use it, you need to require the module like this:
local socket = require("socket")
Notes
- Prior to 11.0, LÖVE doesn't fully supports non-blocking TCP connections on Windows
- Starting with LÖVE 11.0,
require("socket")
no longer creates a global variable. - When using blocking operations (network connect/read/write, or socket.sleep), the whole LÖVE main loop will be blocked, and it is usually a bad idea. So use only non-blocking operations if possible, or use it in a thread.
Reference Manual
For detailed usage, see the reference manual (backup link).
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info