Use read instead of recv on socket
This commit is contained in:
parent
dac9d7c05d
commit
fcbb1bb623
1 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue