frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: TCP chat server written in C# and .NET 9, used in the terminal

https://github.com/Sieep-Coding/simple-chat-csharp
23•sieep•5d ago

Comments

DoctorOW•1d ago
Is this effectively IRC? I know it's not literally compatible but the same basic TCP for chat right?

ETA: Not being dismissive! Cool project!

sieep•23h ago
Admittedly I don't know a lot about networking or IRC clients, but in practice I believe so. The idea was to implement the simplest possible way for 2 people to communicate via TCP.
dahsameer•1d ago
love that its single file each for server and client. simple and neat.
sieep•22h ago
Thank you! I think it goes against Microsoft's C# conventions a bit (i.e. the classes should be separated out more) but I prefer this setup.
tcper•1d ago
Funny, C# app only tested on Linux
throw__away7391•1d ago
This is fairly normal these days, no?
exceptione•1d ago
I remember having seen that Linux is used a lot by Microsoft's .net team.

Linux is the best platform anyways to run your .net core application. With Avalonia you have a good cross-platform solution, albeit that they still depend on X11/Xwayland for Linux.

A shame .net isn't more popular. The MS branding is a problem though. Although .net core is MIT-licensed, most contributions are from MS¹. Still, if MS would ever ditch it (quite unlikely for the foreseeable future), I think the ecosystem will step up.

__

1. F# is an outlier, that is a real community project with lots of contributions from companies and enthusiasts

sieep•22h ago
I highly recommend trying C# on Linux, it works fantastic. Rider on Linux works amazing as well so hats off to Jetbrains.
arethuza•1d ago
What happens if the message entered by the user into the Client is more than 4096 bytes?
nlitened•1d ago
From what I see, the code is incorrect in reading “messages” from TCP socket stream, and will be failing randomly in production with messages longer than 1500 bytes, and also sometimes when even shorter.

Instead, the TCP socket must be treated as a stream of bytes, and use either some delimiter as message boundary (like \n, while escaping any newlines inside JSON), or write message size before the message bytes itself, so that the code knows how many bytes to read until full message is read.

Edit: to clarify, TCP protocol does not guarantee that if you write some bytes in one go, they will be read in one go as well. Instead, they may be split into multiple “reads”, or glued together with the preceding chunk, or both. It’s a “stream of bytes” protocol, it only guarantees that written bytes come one after another in the same order.

So the “naive” message separation used in code above (read a chunk and assume it’s the entire message that was written) will work in manual tests, and likely even in local automated tests, but will randomly break when exposed to real network conditions.

arethuza•1d ago
Thanks - I had a quick scan through the code and noticed the 4096 byte buffers and wondered how larger messages were handled and couldn't see anything but wondered if I was missing something!
sieep•22h ago
Good write up, thanks for taking the time to go into detail. I may try to implement your feedback at some point.
r0x0r007•1d ago
wow, a simple project made by chatGPT reaches hacker news top page. Way to go C# devs! And yes, I am one of them.
DoctorOW•1d ago
It's a simple project but it doesn't have the usual AI code style to me. It reads instead like someone getting the hang of networking in C#. Incidentally, this is OP's first public C# repo.

https://github.com/Sieep-Coding?tab=repositories&q=&type=&la...

r0x0r007•1d ago
yeah maybe, I guess it's fine, I meant no disrespect for the person learning. I can see some git issues so probably a new dev showcasing.I just don't understand how the hn posts work. Shouldn't there be some upvoting of stuff to be on the main page, or it was just released so it appeared?
DoctorOW•1d ago
For what it's worth the HN algorithm is a pretty complex, so I'm still oversimplifying but ti's more about the rate a story gains score than the points themselves. You can get just 5 votes in the first minute you're up and make the front page, which is more or less what this did.
sieep•23h ago
I used Rider's auto-complete for a lot of the code but it is handwritten.

Show HN: A game/benchmark where AI bots hunt each other

https://hiding-robot.vercel.app/
2•-babi-•1h ago•0 comments

Show HN: Open database of link metadata for large-scale analysis

https://github.com/rumca-js/RSS-Link-Database-2025
9•renegat0x0•4d ago•1 comments

Show HN: I visualized the entire history of Citi Bike in the browser

https://bikemap.nyc/
92•freemanjiang•18h ago•29 comments

Show HN: App blocker that tracks your failed attempts to open blocked apps

https://apps.apple.com/in/app/app-blocker-zone/id6753007462
2•appdevfun•2h ago•0 comments

Show HN: I built a "Do not disturb" Device for my home office

https://apoorv.page/blogs/over-engineered-dnd
86•quacky_batak•4d ago•43 comments

Show HN: How I generate animated pixel art with AI and Python

https://sarthakmishra.com/blog/building-animated-sprite-hero
8•sarthak_drool•8h ago•2 comments

Show HN: SMTP Tunnel – A SOCKS5 proxy disguised as email traffic to bypass DPI

https://github.com/x011/smtp-tunnel-proxy
131•lobito25•1d ago•43 comments

Show HN: Free and local browser tool for designing gear models for 3D printing

https://gears.dmtrkovalenko.dev
50•neogoose•1d ago•11 comments

Show HN: Flowscape – A developer-first 2D canvas engine with full scene control

https://github.com/Flowscape-UI/core-sdk
3•flowscape_ui•4h ago•0 comments

Show HN: Shuffle Times – a daily puzzle to unscramble real headlines

https://shuffletimes.com/
2•patrickbuahgiar•5h ago•0 comments

Show HN: KeelTest – AI-driven VS Code unit test generator with bug discovery

https://keelcode.dev/keeltest
28•bulba4aur•23h ago•14 comments

Show HN: An LLM response cache that's aware of dynamic data

https://blog.butter.dev/on-automatic-template-induction-for-response-caching
12•raymondtana•16h ago•1 comments

Show HN: VaultSandbox – Test your real MailGun/SES/etc. integration

https://vaultsandbox.com/
55•vaultsandbox•1d ago•9 comments

Show HN: ADHD Focus Light

https://github.com/zonghaoyuan/adhd-focus-light
6•zonghao•7h ago•0 comments

Show HN: Mantic.sh – A structural code search engine for AI agents

https://github.com/marcoaapfortes/Mantic.sh
76•marcoaapfortes•1d ago•37 comments

Show HN: Comet MCP – Give Claude Code a browser that can click

https://github.com/hanzili/comet-mcp
28•hanzili•4d ago•26 comments

Show HN: Tailsnitch – A security auditor for Tailscale

https://github.com/Adversis/tailsnitch
274•thesubtlety•2d ago•28 comments

Show HN: 48-digit prime numbers every git commit

https://textonly.github.io/git-prime/
66•keepamovin•6d ago•53 comments

Show HN: Audio Isolation with SAM Audio for free

https://github.com/alexhamidi/samantha
3•ahamidi_•7h ago•0 comments

Show HN: A to Z – A word game I built from a childhood road trip memory

https://a26z.fun/
11•jackhulbert•17h ago•7 comments

Show HN: Tylax – A bidirectional LaTeX to Typst converter in Rust

https://github.com/scipenai/tylax
23•democat•21h ago•4 comments

Show HN: DoNotNotify – Log and intelligently block notifications on Android

https://donotnotify.com/
342•awaaz•2d ago•164 comments

Show HN: Prism.Tools – Free and privacy-focused developer utilities

https://blgardner.github.io/prism.tools/
367•BLGardner•2d ago•99 comments

Show HN: I built Mike – AI motion graphics

https://www.mike.new/
3•chcardoz•9h ago•2 comments

Show HN: Stash – Sync Markdown Files with Apple Notes via CLI

https://github.com/shakedlokits/stash
72•shuka•1d ago•21 comments

Show HN: Titan AI Explore – A curated hub for AI tools, tutorials, and projects

https://www.titanaiexplore.com/
2•chynnahe•10h ago•0 comments

Show HN: Make audio loops online

https://makeloops.online/
67•bilalba•2d ago•22 comments

Show HN: SludgeReport.io – like that other site but AI, Tech, Startup News

https://sludgereport.io/
2•stets•10h ago•3 comments

Show HN: Server-rendered multiplayer games with Lua (no client code)

https://cleoselene.com/
79•brunovcosta•3d ago•58 comments

Show HN: DailyWave – a one-task-at-a-time productivity app (open source)

https://github.com/kks0488/dailywave
5•kyoungsookim•11h ago•0 comments