aboutsummaryrefslogtreecommitdiff
path: root/lib/std/net.zig
AgeCommit message (Collapse)Author
2021-01-11Apparently unix sockets are supported on WindowsLemonBoy
Starting from Windows 10 build 17063.
2021-01-11std: Decouple network streams from fs.FileLemonBoy
The overlap between files and sockets is minimal and lumping them together means supporting only a small subset of the functionalities provided by the OS. Moreover the socket and file handles are not always interchangeable: on Windows one should use Winsock's close() call rather than the one used for common files.
2021-01-07Reduce use of deprecated IO typesJay Petacat
Related: #4917
2021-01-06std: Rename ArrayList shrink => shrinkAndFreeAlex Cameron
2021-01-02std: Use {s} instead of {} when printing stringsLemonBoy
2020-12-31Year++Frank Denis
2020-12-23move ArrayListSentineled to std lib orphanageVeikka Tuominen
2020-12-01Localhost is special (#6955)daurnimator
* std: always return loopback address when looking up localhost * std: also return Ipv6 loopback * std: remove commented out obsolete code
2020-11-30std/os: remove unneeded error from accept errorsetIsaac Freund
POSIX compliant fnctl cannot return EPERM when getting/setting the given flags. See the specification here: https://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
2020-11-29std.meta: add assumeSentinelJonathan Marler
2020-11-25std: use mem.asBytes in Ip4Address.parse so it works at comptimedaurnimator
2020-11-07remove deprecated uses of ArrayList.spanJosh Holland
2020-10-28More fixups for Windows targetsLemonBoy
* Use closeSocket on sockets instead of plain old close, the latter doesn't work on them. * Use winsocket2 everywhere, mingw has no BSD sockets.
2020-10-27std: Add basic smoke test for net functionalityLemonBoy
2020-10-25fix type mismatch in std.net.StreamServerjohnLate
Parameter in std.os.listen is u31. Fixes ziglang#6775
2020-10-21Fix std.net.connectUnixSocket in evented I/O modeheidezomp
The event loop constant was missing.
2020-09-24recvfromLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24sendtoLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24connectLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24acceptLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-03os: return error.SocketNotListening for EINVAL on accept (#6226)Kenta Iwasaki
2020-09-01std: Fix C-string with missing NUL terminatorLemonBoy
Spotted thanks to the stricter conversion rules.
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-08-04zig fmtAndrew Kelley
2020-07-27Provide Ip4Address and Ip6Address in addition to AddressJonathan Marler
2020-07-11run zig fmt on std lib and self hostedVexu
2020-07-04std.mem.dupe is deprecated, move all references in stdjoachimschmidt557
Replaced all occurences of std.mem.dupe in stdlib with Allocator.dupe/std.mem.dupeZ -> Allocator.dupeZ
2020-06-08std.sort: give comparator functions a context parameterAndrew Kelley
2020-06-07tcpConnectToHost try all addresses in AddressListIan Simonson
The AddressList returned can contain more than one item e.g. the ipv4 and ipv6 addresses for a given hostname. Previously if a server had multiple addresses but was not listening on one of them Zig would give up immediately. Now on std.os.ConnectError.ConnectionRefused Zig will try the next address in the list. Zig still gives up on all other errors as they are related to the system and system resources rather than whether the remote server is listening on a particular address.
2020-06-02cleanupsAndrew Kelley
* improve docs * add TODO comments for things that don't have open issues * remove redundant namespacing of struct fields * guard against ioctl returning EINTR * remove the general std.os.ioctl function in favor of the specific ioctl_SIOCGIFINDEX function. This allows us to have a more precise error set, and more type-safe API.
2020-06-02Replace os.linux to os.systemLuna
2020-06-02Use resolveIp when looking up addresses on linuxLuna
2020-06-02Add std.os.ioctlLuna
2020-06-02Use IFNAMESIZE for scope id valueLuna
2020-06-02Add validation for scope idsLuna
2020-06-02Remove warn() callsLuna
2020-06-02Fix ifreq definitionLuna
2020-06-02Change Unsupported to InterfaceNotFoundLuna
2020-06-02Make interface name null-terminated before syscallLuna
2020-06-02Stop using mem.len on arrayLuna
2020-06-02Add ioctl errorsLuna
2020-06-02Only resolve scope id when neededLuna
2020-06-02Fix typo and add if_nametoindexLuna
2020-06-02Add basics of resolveIp6Luna
Instead of streaming the scope id digits to an u32, we keep a [32]u8 in the stack and fill it up with the characters we get for scope id.
2020-05-31more windows network fixesJonathan Marler
* support posix SOCK_NONBLOCK and SOCK_CLOEXEC flags on windows * fix bugs in os.socket and os.connect to return at the correct place
2020-05-30convert getaddrinfo rc to enum before switching on itJonathan Marler
2020-05-29more windows network support, including dnsJonathan Marler
2020-05-24(breaking) std.time fixups and API changesAndrew Kelley
Remove the constants that assume a base unit in favor of explicit x_per_y constants. nanosecond calendar timestamps now use i128 for the type. This affects fs.File.Stat, std.time.nanoTimestamp, and fs.File.updateTimes. calendar timestamps are now signed, because the value can be less than the epoch (the user can set their computer time to whatever they wish). implement std.os.clock_gettime for Windows when clock id is CLOCK_CALENDAR.
2020-05-11make Address.getOsSockLen pubJonathan Marler
2020-05-09Remove fs.File artifact from connectUnixSocketHaze Booth