Skip to content

TcpListener constructor now creates socket with ProtocolType.Tcp - #135

Merged
josesimoes merged 1 commit into
nanoframework:mainfrom
alberk8:main
Jul 12, 2026
Merged

TcpListener constructor now creates socket with ProtocolType.Tcp#135
josesimoes merged 1 commit into
nanoframework:mainfrom
alberk8:main

Conversation

@alberk8

@alberk8 alberk8 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Description

Creating a TcpListener cause an Exception to the thrown.

Motivation and Context

How Has This Been Tested?

ESP32 REV3 and ESP32 S3

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

@nfbot nfbot added the Type: bug Something isn't working label Jul 12, 2026
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

TcpListener now initializes its server socket with ProtocolType.Tcp in both the IPEndPoint constructor and lazy Start(int backlog) path. No public APIs or other listener behavior changed.

Changes

TcpListener protocol correction

Layer / File(s) Summary
Use TCP protocol for server sockets
nanoframework.System.Net.Sockets.TcpClient/Sockets/TcpListener.cs
The endpoint constructor and lazy startup initialization now create the server socket with ProtocolType.Tcp instead of ProtocolType.IPv4.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title matches the TcpListener protocol-type fix and follows the formatting rules.
Description check ✅ Passed The description is clearly related to the TcpListener exception fix and testing context.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Ellerbach

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@Ellerbach

Copy link
Copy Markdown
Member

ho! Nice finding!

@josesimoes josesimoes changed the title Change the ProtocolType.IPv4 to correct ProtocolType.Tcp TcpListener constructor now creates socket with ProtocolType.Tcp Jul 12, 2026

@josesimoes josesimoes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@josesimoes
josesimoes merged commit 6c86147 into nanoframework:main Jul 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TcpListener Error On New

4 participants