aboutsummaryrefslogtreecommitdiff
path: root/lib/std/net.zig
AgeCommit message (Collapse)Author
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
2020-05-08fix more private member accessVexu
2020-05-03Pass filtered_sock_type to system.socket. Cover PermissionDenied errorCato
2020-05-02solve the problem with Darwin shims in std.os insteadAndrew Kelley
* implement SOCK_NONBLOCK and SOCK_CLOEXEC Darwin shims in std.os * revert changes to std.net * remove os.accept and rename os.accept4 to os.accept
2020-05-02Fixed Darwin-incompatible socket flags and unavailable system callsCato
2020-05-01cleanup and fixes. behavior tests passing with evented I/OAndrew Kelley
2020-04-04rename mem.separate to mem.splitxackus
2020-04-02new ArrayList API: fix everything elsexackus
2020-04-01(breaking) std.Buffer => std.ArrayListSentineled(u8, 0)Andrew Kelley
This new name (and the fact that it is a function returning a type) will make it more clear which use cases are better suited for ArrayList and which are better suited for ArrayListSentineled. Also for consistency with ArrayList, * `append` => `appendSlice` * `appendByte` => `append` Thanks daurnimator for pointing out the confusion of std.Buffer.
2020-03-30std lib API deprecations for the upcoming 0.6.0 releaseAndrew Kelley
See #3811
2020-03-28tcpConnectToHost - fixed compilation errorSebastian
before: ``` std\net.zig:403:23: error: type '@TypeOf(std.net.getAddressList).ReturnType.ErrorSet!*std.net.AddressList' does not support field access const addrs = list.addrs.toSliceConst(); ^ ```
2020-03-20ir: Peer type resolution between ?[]T and *[N]TLemonBoy
Closes #4767
2020-03-19std.net: remove the hack from earlier in the branchAndrew Kelley
2020-03-19std lib fixups for new semanticsAndrew Kelley
std lib tests are passing now
2020-03-12Replace fmt with new fmtstreamBenjamin Feng
2020-03-12Convert fmt.bufPrint / fmt.allocPrintBenjamin Feng
2020-03-12Integrated outstreams with new formatterBenjamin Feng
2020-03-10update standard library to new I/O streams APIAndrew Kelley
2020-03-01breaking: std.mem.len no longer takes a type argumentAndrew Kelley
also update fmt code to use std.mem.span.
2020-02-28introduce operating system version ranges as part of the targetAndrew Kelley
* re-introduce `std.build.Target` which is distinct from `std.Target`. `std.build.Target` wraps `std.Target` so that it can be annotated as "the native target" or an explicitly specified target. * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a struct which has the tag as well as version range information. * `std.elf` gains some more ELF header constants. * `std.Target.parse` gains the ability to parse operating system version ranges as well as glibc version. * Added `std.Target.isGnuLibC()`. * self-hosted dynamic linker detection and glibc version detection. This also adds the improved logic using `/usr/bin/env` rather than invoking the system C compiler to find the dynamic linker when zig is statically linked. Related: #2084 Note: this `/usr/bin/env` code is work-in-progress. * `-target-glibc` CLI option is removed in favor of the new `-target` syntax. Example: `-target x86_64-linux-gnu.2.27` closes #1907
2020-02-24Merge pull request #4516 from xackus/remove-bytes-to-sliceAndrew Kelley
remove @bytesToSlice, @sliceToBytes from the language
2020-02-21annotate TODO comment with bug tracker linkAndrew Kelley
2020-02-21remove @bytesToSlice, @sliceToBytes from std libxackus
2020-02-08std lib typo fixupsAndrew Kelley
2020-02-05std.fmt.format: comptime output parameterAndrew Kelley
2020-01-18std: turn EAI_ constants into a non-exhaustive enumdaurnimator
2020-01-02Implement the callconv() annotationLemonBoy
2019-12-30std.net: use mem.toBytesLuna