change "get" to "is"

This commit is contained in:
Xertis
2025-10-01 01:05:30 +03:00
parent 86053fa86d
commit 1f049c2fd0
5 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -413,11 +413,11 @@ static int l_set_nodelay(lua::State* L, network::Network& network) {
return 0;
}
static int l_get_nodelay(lua::State* L, network::Network& network) {
static int l_is_nodelay(lua::State* L, network::Network& network) {
u64id_t id = lua::tointeger(L, 1);
if (auto connection = network.getConnection(id)) {
if (connection->getTransportType() == network::TransportType::TCP) {
bool noDelay = dynamic_cast<network::TcpConnection*>(connection)->getNoDelay();
bool noDelay = dynamic_cast<network::TcpConnection*>(connection)->isNoDelay();
return lua::pushboolean(L, noDelay);
}
}
@@ -540,6 +540,6 @@ const luaL_Reg networklib[] = {
{"__is_serveropen", wrap<l_is_serveropen>},
{"__get_serverport", wrap<l_get_serverport>},
{"__set_nodelay", wrap<l_set_nodelay>},
{"__get_nodelay", wrap<l_get_nodelay>},
{"__is_nodelay", wrap<l_is_nodelay>},
{NULL, NULL}
};
+1 -1
View File
@@ -362,7 +362,7 @@ public:
}
}
bool getNoDelay() const override {
bool isNoDelay() const override {
int opt = 0;
socklen_t len = sizeof(opt);
if (getsockopt(descriptor, IPPROTO_TCP, TCP_NODELAY, (char*)&opt, &len) < 0) {
+1 -1
View File
@@ -78,7 +78,7 @@ namespace network {
virtual int recv(char* buffer, size_t length) = 0;
virtual int available() = 0;
virtual void setNoDelay(bool noDelay) = 0;
[[nodiscard]] virtual bool getNoDelay() const = 0;
[[nodiscard]] virtual bool isNoDelay() const = 0;
[[nodiscard]] TransportType getTransportType() const noexcept override {
return TransportType::TCP;