Skip to content

connect timeout gets masked out by irrelevant error #151

@CuriousGeorgiy

Description

@CuriousGeorgiy

Consider this trivial snippet with a 0 timeout:

#include "../src/Client/Connector.hpp"

using Buf_t = tnt::Buffer<16 * 1024>;
using Net_t = LibevNetProvider<Buf_t, DefaultStream>;

int
main()
{
	Connector<Buf_t, Net_t> client;
	Connection<Buf_t, Net_t> conn(client);
	struct ConnectOptions conn_opts{
		.address = "127.0.0.1",
		.service = "3301",
		.connect_timeout = 0,     		
	};
	client.connect(conn, conn_opts);
}

However, in the logs instead of a timeout error you will see:

ERROR: Failed to connect: Operation now in progress
ERROR: Failed to connect to 127.0.0.1:3301

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions