Difference between revisions of "socket"

(Reference manual appears to be down, so I pointed it to the archived link)
m (Move Windows notice)
Line 1: Line 1:
{{notice|Since [[11.0]], LÖVE fully supports non-blocking TCP connections on Windows}}
 
 
{{newin|[[0.5.0]]|050|type=module}}
 
{{newin|[[0.5.0]]|050|type=module}}
 
Implements a [http://w3.impa.br/~diego/software/luasocket/ luasocket] module for TCP/UDP networking.
 
Implements a [http://w3.impa.br/~diego/software/luasocket/ luasocket] module for TCP/UDP networking.
Line 6: Line 5:
 
local socket = require("socket")
 
local socket = require("socket")
 
</source>
 
</source>
 +
 +
{{notice|Prior to [[11.0]], LÖVE doesn't fully supports non-blocking TCP connections on Windows}}
  
 
== Notes ==
 
== Notes ==

Revision as of 08:06, 21 March 2022

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")
O.png Prior to 11.0, LÖVE doesn't fully supports non-blocking TCP connections on Windows  


Notes

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.

See Also



Other Languages