New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ability to remove server after adding. #17
Conversation
Any objections or update on this? |
I wonder too... |
This PR requires an update of the documentation to make it complete. |
Thijs, thank you for looking into this. What kind of documentation do we need? I don't see any documentation in the source files themselves... |
so far I've been manually editing the docs in |
note: whilst TCP sockets have separate master and client socket objects, UDP only has a single socket. So in case a UDP socket has been wrapped, the user might pass the wrapped socket to this method. consider updating to something like this: function copas.removeserver(server)
local s, mt = server, getmetatable(server)
if mt == _skt_mt or mt == _skt_mt_udp then
s = server.socket
end
_servers[s] = nil
_reading:remove(s)
return server:close()
end
|
Added ability to remove server after adding.
I just comitted the changes, including fix and docs. |
Great; thanks Thijs! |
commit 37a07a1 Merge: a76c8a9 4e3111a Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Fri Mar 6 10:04:58 2015 +0100 Merge pull request lunarmodules#26 from Tieske/fix_autoclose fixed autoclose not closing udp sockets. added docs for autoclose commit 4e3111a Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Fri Mar 6 09:57:39 2015 +0100 fixed autoclose not closing udp sockets. added docs for autoclose commit a76c8a9 Merge: be58265 10f0485 Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Thu Mar 5 17:34:25 2015 +0100 Merge pull request lunarmodules#25 from Tieske/exit Exit loop when all is done commit 10f0485 Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Thu Mar 5 17:23:02 2015 +0100 fixed doc error commit e38972d Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Thu Mar 5 17:19:06 2015 +0100 added doc updates commit b49f837 Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Thu Mar 5 16:54:31 2015 +0100 Exit loop when all is done (now that more client support has been added). Added comments regarding the watchdog. commit be58265 Merge: 05eeb53 a69e851 Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Tue Mar 3 09:40:14 2015 +0100 Merge pull request lunarmodules#24 from Tieske/master removed duplicate data from readme commit a69e851 Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Tue Mar 3 09:37:55 2015 +0100 removed duplicate data commit 05eeb53 Merge: 00bcd5f 25ab0dd Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Mon Mar 2 18:12:38 2015 +0100 Merge pull request lunarmodules#23 from Tieske/master Updated documentation, and support for wrapped sockets when removing a s... commit 25ab0dd Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Mon Mar 2 18:11:40 2015 +0100 Updated documentation, and support for wrapped sockets when removing a server commit 00bcd5f Merge: c6492e5 ee77f93 Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Mon Mar 2 17:30:57 2015 +0100 Merge pull request lunarmodules#17 from pkulchenko/remove-server Added ability to remove server after adding. commit c6492e5 Merge: b718ad1 218667f Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Mon Mar 2 17:30:07 2015 +0100 Merge pull request lunarmodules#22 from Tieske/cleanup Cleanup commit 218667f Author: Thijs Schreijer <thijs@thijsschreijer.nl> Date: Sat Feb 28 09:07:18 2015 +0100 Cleanup. Marked some legacy Lua 5.1 code for future removal, removed some unused locals and deadcode commit b718ad1 Merge: d2474ab 17c21ef Author: Hisham Muhammad <hisham@gobolinux.org> Date: Thu Oct 9 12:26:47 2014 -0300 Merge pull request lunarmodules#20 from ignacio/patch-1 Change link to point to keplerproject.github.io/copas commit 17c21ef Author: Ignacio Burgueño <iburgueno@gmail.com> Date: Thu Oct 9 12:43:00 2014 -0200 Change link to point to keplerproject.github.io/copas Changes the link to point to keplerproject.github.io/copas The link in the description should be updated too.
Copas supports adding a new server, but no way to remove the added server. This patch adds this ability.
:close
call is needed to allow the socket to be reused right away after removing the server.