Tests/LibCore: Enable TestLibCoreStream in Windows CI

This commit is contained in:
ayeteadoe 2025-07-14 15:27:18 -07:00 committed by Andrew Kaster
commit 688d0ada97
Notes: github-actions[bot] 2025-08-07 02:25:42 +00:00
5 changed files with 89 additions and 38 deletions

View file

@ -292,6 +292,21 @@ ErrorOr<NonnullOwnPtr<UDPSocket>> UDPSocket::connect(SocketAddress const& addres
return socket;
}
ErrorOr<Bytes> UDPSocket::read_some(Bytes buffer)
{
auto pending_bytes = TRY(this->pending_bytes());
if (pending_bytes > buffer.size()) {
// With UDP datagrams, reading a datagram into a buffer that's
// smaller than the datagram's size will cause the rest of the
// datagram to be discarded. That's not very nice, so let's bail
// early, telling the caller that he should allocate a bigger
// buffer.
return Error::from_errno(EMSGSIZE);
}
return m_helper.read(buffer, default_flags());
}
ErrorOr<NonnullOwnPtr<LocalSocket>> LocalSocket::connect(ByteString const& path, PreventSIGPIPE prevent_sigpipe)
{
auto socket = TRY(adopt_nonnull_own_or_enomem(new (nothrow) LocalSocket(prevent_sigpipe)));