FSharp.FIO.Sockets 0.2.2-beta

This is a prerelease version of FSharp.FIO.Sockets.
dotnet add package FSharp.FIO.Sockets --version 0.2.2-beta
                    
NuGet\Install-Package FSharp.FIO.Sockets -Version 0.2.2-beta
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FSharp.FIO.Sockets" Version="0.2.2-beta" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FSharp.FIO.Sockets" Version="0.2.2-beta" />
                    
Directory.Packages.props
<PackageReference Include="FSharp.FIO.Sockets" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FSharp.FIO.Sockets --version 0.2.2-beta
                    
#r "nuget: FSharp.FIO.Sockets, 0.2.2-beta"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FSharp.FIO.Sockets@0.2.2-beta
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FSharp.FIO.Sockets&version=0.2.2-beta&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FSharp.FIO.Sockets&version=0.2.2-beta&prerelease
                    
Install as a Cake Tool

FIO.Sockets

NuGet Run Tests License: MIT

TCP sockets for FIO. Connect, send, and receive as composable effects — connections are scoped and released for you, and failures surface as a typed SocketError rather than raw exceptions.

  • Client connectionsSocketClient.withConnectionTo / withConnection scope a socket's lifetime
  • ServerServerSocket.bind / accept / close to serve clients
  • Connection pooling — reuse connections under load
  • Custom codecs — send and receive typed messages, not just strings

Install

dotnet add package FSharp.FIO.Sockets

Quick Start

open FIO.DSL
open FIO.Sockets

let program =
    SocketClient.withConnectionTo "localhost" 8080 (fun socket ->
        fio {
            do! socket.SendString "Hello, server!"
            return! socket.ReceiveString 1024
        })

Server

open FIO.DSL
open FIO.Sockets

let server = fio {
    let! config = ServerSocketConfig.create "localhost" 8080
    let! serverSocket = ServerSocket.bind config
    let! clientSocket = ServerSocket.accept serverSocket
    let! message = clientSocket.ReceiveString 1024
    do! clientSocket.SendString $"echo: {message}"
    do! ServerSocket.close serverSocket
}

Errors

Operations fail with a typed SocketError — including ConnectionFailed, ConnectionClosed, SendFailed, ReceiveFailed, TimeoutError, BindFailed, AcceptFailed, PoolExhausted, CodecError, GeneralError — with SocketError.fromException / SocketError.toException to bridge raw exceptions.

Examples · FIO core · MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.2-beta 63 7/12/2026
0.2.1-beta 66 7/9/2026
0.2.0-beta 72 7/6/2026
0.1.15-alpha 74 6/30/2026
0.1.10-alpha 65 6/24/2026
0.1.0-alpha 87 6/18/2026