mirror of
https://github.com/Kiritow/LuaEngine.git
synced 2024-03-22 13:11:45 +08:00
22 lines
618 B
C++
22 lines
618 B
C++
#include "Socket.h"
|
|
|
|
/*
|
|
class TCPSocket
|
|
constructor(nonblocking: boolean)
|
|
close()
|
|
setblocking(nonblocking: boolean)
|
|
listen([ip: string], port: int, [backlog: int]) Address default to 0.0.0.0, backlog default to 10.
|
|
|
|
# Blocking mode: All unexpected error will be raised as exception.
|
|
connect(ip: string, port: int)
|
|
accept(): TCPSocket PeerIP PeerPort
|
|
send(data: string) All data will be sent before return.
|
|
recv([maxsize: int]): string. Default to 4KB.
|
|
|
|
# Non-blocking mode:
|
|
connect(ip: string, port: int)
|
|
accept(): (TCPSocket PeerIP PeerPort) or nil
|
|
send(data: string)
|
|
recv([maxsize: int]): string
|
|
*/
|