nathhB / nbnet

single header C(99) library to implement client-server network code for games
zlib License
441 stars 30 forks source link

NBN_GameClient_Start does not support domain name #28

Open wlxmhls opened 1 year ago

wlxmhls commented 1 year ago

Hello, the second parameter of NBN_GameClient_Start can not be domain name: int NBN_GameClient_Start(const char *protocol_name, const char *ip_address, uint16_t port, bool encryption, uint8_t *connection_data)

So if I try to use it like: NBN_GameClient_Start(EXAMPLE_PROTOCOL_NAME, "localhost", SERVER_PORT, false, NULL)

It fails: ERROR: Failed to resolve IP address from localhost

It means only dotted IP address is supported. Could you make it support domain name? Thank you!

nathhB commented 1 year ago

I'll take a look in the future. Also, it should not be too hard to add support for it, so you can probably implement it yourself and create a PR. I would really appreciate it.