php / php/php-src

Add SO_LINGER option for streams

Open
#14,111 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Category: Streams Feature
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

stream_context_set_option() function currently does not list/support socket layer SO_LINGER option. Adding this, and probably any other socket options to streams will improve stream functionality.

$conn = @stream_socket_accept(9999, 0)
$stream_opts = [
'socket' => ['so_linger' => 0 ]
];
stream_context_set_option($conn, $stream_opts);

Contributor guide

Open the contributing guide

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.

Research direction

Start by tracing stream_context_set_option() and the stream socket option handling, then compare how SO_LINGER is represented and applied at the socket layer. Done means the so_linger option is accepted for streams and its setting affects the underlying socket as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, php
Domain
backend, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.