Skip to content

Patched SOCKET and made socket READF, READU and CLOSE working, at last!#2185

Open
GillesDuvert wants to merge 3 commits intognudatalanguage:masterfrom
GillesDuvert:socket_ok
Open

Patched SOCKET and made socket READF, READU and CLOSE working, at last!#2185
GillesDuvert wants to merge 3 commits intognudatalanguage:masterfrom
GillesDuvert:socket_ok

Conversation

@GillesDuvert
Copy link
Copy Markdown
Contributor

following #2178, changed obsoleted gethostbyname() to getaddrinfo(). Testing this, I realized that neither READF or READU on sockets were working correctly (i.e. as IDL does) or even working at all. This since the beginnings of GDL.
Because the buffering used, necessary because GDL has opted to a generalized C++ interface for I/O using std::streams, was not completely consistent in every case, especially when disguising a socket as a bona fide std::stringstream. For example, sockets were NOT CLOSED by the CLOSE command. Socket reads were buffering the data without knowing the amount of data to be read, allowing for timeouts or missing some data. Hopefully this is now beyond us.

Giloo added 2 commits March 27, 2026 10:18
following gnudatalanguage#2178, changed obsoleted gethostbyname() to getaddrinfo().
Testing this, I realized that neither READF or READU on sockets were working correctly (i.e. as IDL does) or even working at all.
This since the beginnings of GDL.
Because the buffering used, necessary because GDL has opted to a generalized C++ interface for I/O using std::streams, was not completely consistent in every case, especially when disguising a socket as a bona fide std::stringstream.
For example, sockets were NOT CLOSED by the CLOSE command.
Socket reads were buffering the data without knowing the amount of data to be read, allowing for timeouts or missing some data.
Hopefully this is now beyond us.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 18.18182% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.97%. Comparing base (3cb957d) to head (b8fa981).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/io.cpp 3.57% 27 Missing ⚠️
src/basic_pro.cpp 0.00% 14 Missing ⚠️
src/read.cpp 45.83% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2185      +/-   ##
==========================================
- Coverage   41.97%   41.97%   -0.01%     
==========================================
  Files         457      457              
  Lines      115326   115341      +15     
  Branches    22743    22750       +7     
==========================================
- Hits        48412    48411       -1     
- Misses      66914    66930      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…ation of streams that are not tailored for handling socket data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant