mirror of https://github.com/mgba-emu/mgba.git
Scripting: Return status from socket.connect, fix coding style
This commit is contained in:
parent
7520d8fc06
commit
b60e0b9282
|
@ -83,7 +83,7 @@ server = nil
|
|||
while not server do
|
||||
server, err = socket.bind(nil, port)
|
||||
if err then
|
||||
if err == "address in use" then
|
||||
if err == socket.ERRORS.ADDRESS_IN_USE then
|
||||
port = port + 1
|
||||
else
|
||||
console:error(ST_format("Bind", err, true))
|
||||
|
|
|
@ -126,6 +126,7 @@ static const char* _socketLuaSource =
|
|||
" end,\n"
|
||||
" connect = function(self, address, port)\n"
|
||||
" local status = self._s:connect(address, port)\n"
|
||||
" return socket._wrap(status)\n"
|
||||
" end,\n"
|
||||
" listen = function(self, backlog)\n"
|
||||
" local status = self._s:listen(backlog or 1)\n"
|
||||
|
|
Loading…
Reference in New Issue