Use read instead of recv on socket

This commit is contained in:
jaina heartles 2022-11-17 19:48:07 -08:00
parent dac9d7c05d
commit fcbb1bb623

View file

@ -38,7 +38,7 @@ pub const Stream = struct {
os.closeSocket(self.socket);
}
pub const ReadError = os.RecvFromError;
pub const ReadError = os.ReadError;
pub const WriteError = os.SendError;
pub const Reader = std.io.Reader(Stream, ReadError, read);
@ -48,7 +48,7 @@ pub const Stream = struct {
if (std.io.is_async) @compileError("TODO: async not supported");
if (self.kind != .tcp) @panic("TODO");
return os.recv(self.socket, buffer, 0);
return os.read(self.socket, buffer);
}
pub fn write(self: Stream, buffer: []const u8) WriteError!usize {