files
syscalls/doc/manual.md

115 lines
978 B
Markdown

# Manual
```lua
local syscalls = require("syscalls")
```
## Events
```lua
syscalls.Event.<EventName>
```
## Graphic
## Sockets
### OpenSocket
```lua
local socket, err = syscalls.OpenSocket()
if err then
print("Error", err)
else
print("Ok")
end
```
### CloseSocket(socket)
### PairSocket()
```lua
local first, second = PairSocket()
if first then
print("OK")
else
print("Error:", second)
end
```
### Bind(socket, address)
### Listen(socket, backlog)
### Connect()
### Accept
### Receive
## SetSocketOption
### GetSocketOption
### Socket types
```lua
syscalls.SOCK.<Value>
```
+ `STREAM`
+ `RAW`
+ `DGRAM`
### Address families
```lua
syscalls.AF.<Value>
```
+ `UNSPEC`
+ `LOCAL`
+ `INET`
+ `INET4`
+ `INET6`
### IP options
```lua
syscalls.IP.<Value>
```
+ `TTL`
### IP protocols
```lua
syscalls.IPPROTO.<Value>
```
+ `IP`
+ `ICMP`
+ `TCP`
+ `UDP`
+ `RAW`
### Socket options
```lua
syscalls.SO.<Value>
```
+ `BINDTODEVICE`
+ `NONBLOCK`