-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Closed as not planned
Copy link
Labels
standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
Hi, new to zig, started learning a few days ago, was playing around with it trying to connect to tcp server and I kept getting an error for my code which looked roughly like this
var port: u16 = 6379;
var addr = "localhost";
var conn = try std.net.tcpConnectToAddress(try net.Address.parseIp4(addr, port));the error said InvalidCharacter so I had to do a little digging and saw that while parsing the address the code was looking for "." which gave me the clue to use 127.0.0.1 instead of localhost and my code worked.
The TCP libraries that I have played around with in other languages accept both 127.0.0.1 and localhost I was wondering it it would be possible to add a condition to check for "localhost" in parseIp4 function.
Let me know if you would like a PR for this. 😄
Metadata
Metadata
Assignees
Labels
standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.