socket/socket-stream confusion in tests

Open
#133 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
networking

Research direction

Start by reproducing USOCKET-TEST::SOCKET-LISTEN.1 and USOCKET-TEST::SOCKET-LISTEN.2 on SBCL 2.5.0 and compare the uses of usocket:socket with usocket:socket-stream. Read the documentation for both accessors to determine the intended return type. Done means resolving whether the tests or the socket function is incorrect and updating the relevant behavior or documentation.

Written by the indexing model from the issue text.

Description

Hi,

The tests USOCKET-TEST::SOCKET-LISTEN.1 and USOCKET-TEST::SOCKET-LISTEN.2 fail on sbcl 2.5.0 with errors like:

#<TYPE-ERROR expected-type: STREAM..
  [condition]

Slots with :INSTANCE allocation:
  DATUM                          = #<SB-BSD-SOCKETS:INET-SOCKET fd: 7 {10014C5923}>
  EXPECTED-TYPE                  = STREAM
  CONTEXT                        = NIL
Test USOCKET-TEST::SOCKET-LISTEN.2 failed

This code has (read-byte (usocket:socket server)) while I expected (read-byte (usocket:socket-stream server)). In fact with this the tests works.

Is this a fault in the test or in the usocket:socket function? From the documentation it is not clear to me.

Dominant language
Common Lisp
Stars
244
Forks
56
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from usocket/usocket

All issues in usocket/usocket

Similar issues

More Networking issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.