Skip to content

Instantly share code, notes, and snippets.

View caglarenes's full-sized avatar
🔬

Enes Çağlar caglarenes

🔬
View GitHub Profile
@davidfowl
davidfowl / Minimal-protobuf.cs
Last active December 16, 2024 12:58
Minimal + protobuf
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.WebUtilities;
using ProtoBuf;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => "POST a protobuf message to the /");
app.MapPost("/", (Proto<Person> p) => Results.Extensions.Protobuf(p.Item))
.Accepts<Person>("application/protobuf");
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Net;
using System.Net.Sockets;
using System.Net.WebSockets;
@define-private-public
define-private-public / Block.cs
Last active May 1, 2023 06:30
UDP based file transfer in C#
// Filename: Block.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.Text;
using System.Linq;
namespace UdpFileTransfer
{