diff options
Diffstat (limited to 'Sluift/component.cpp')
| -rw-r--r-- | Sluift/component.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Sluift/component.cpp b/Sluift/component.cpp index f3c2e37..c1b1da4 100644 --- a/Sluift/component.cpp +++ b/Sluift/component.cpp | |||
| @@ -96,13 +96,13 @@ SLUIFT_LUA_FUNCTION(Component, async_connect) { | |||
| 96 | SluiftComponent* component = getComponent(L); | 96 | SluiftComponent* component = getComponent(L); |
| 97 | 97 | ||
| 98 | std::string host; | 98 | std::string host; |
| 99 | int port = 0; | 99 | unsigned short port = 0; |
| 100 | if (lua_istable(L, 2)) { | 100 | if (lua_istable(L, 2)) { |
| 101 | if (boost::optional<std::string> hostString = Lua::getStringField(L, 2, "host")) { | 101 | if (boost::optional<std::string> hostString = Lua::getStringField(L, 2, "host")) { |
| 102 | host = *hostString; | 102 | host = *hostString; |
| 103 | } | 103 | } |
| 104 | if (boost::optional<int> portInt = Lua::getIntField(L, 2, "port")) { | 104 | if (boost::optional<int> portInt = Lua::getIntField(L, 2, "port")) { |
| 105 | port = *portInt; | 105 | port = boost::numeric_cast<unsigned short>(*portInt); |
| 106 | } | 106 | } |
| 107 | } | 107 | } |
| 108 | component->connect(host, port); | 108 | component->connect(host, port); |
Swift