News for hackers. Stuff that matters.
Re:Basic proxy implementation using io_uring by packetlost on Saturday February 17, 2024 @08:58PM (#39415394)
That's pretty small for a complete C application...
Re:Basic proxy implementation using io_uring by userbinator on Sunday February 18, 2024 @12:57AM (#39416584)
Various things that I have written in less than 1300 lines of C:

    * TCP proxy (~200)
    * Win32 GUI TOTP authenticator (~230)
    * GIF decoder (~300)
    * PNG decoder (~470)
    * JPEG decoder (~770)
    * H.261 decoder (~740)
    * H.263 decoder (~1100)
    * MPEG-1 decoder (~1100)
All of the above I would consider a "complete C application".

Edit: looks like some people just have no respect for craftsmanship.

Re:Basic proxy implementation using io_uring by rogers12 on Sunday February 18, 2024 @02:50AM (#39417073)
You should go back and add error handling to your C programs
Re:Basic proxy implementation using io_uring by userbinator on Sunday February 18, 2024 @02:56AM (#39417104)
Are you implying I don't already have error handling?

Personal insults are not acceptable here.

Re:Basic proxy implementation using io_uring by verticalscaler on Sunday February 18, 2024 @05:28AM (#39417907)
My dude, how would he know better? It is a perfectly fair assumption given the average C code base. Those numbers are unusually succinct.

You sound like you really know what you're doing, if you can, please share some of this for our edification and don't take things personally.

Re:Basic proxy implementation using io_uring by znpy on Sunday February 18, 2024 @08:07AM (#39418727)
> Are you implying I don't already have error handling?

With baseless claims, no code, no other consideration? I would not imply that, I would assume that.

Re:Basic proxy implementation using io_uring by lionkor on Sunday February 18, 2024 @04:23AM (#39417541)
post your code
Re:Basic proxy implementation using io_uring by littlestymaar on Sunday February 18, 2024 @06:20AM (#39418167)
How is a codec a complete application?
Re:Basic proxy implementation using io_uring by unmole on Sunday February 18, 2024 @06:42AM (#39418268)
Talk is cheap, show me the code.
Re:Basic proxy implementation using io_uring by znpy on Sunday February 18, 2024 @08:06AM (#39418721)
came to write the same thing. take my upvote.
Re:Basic proxy implementation using io_uring by secondcoming on Sunday February 18, 2024 @08:08AM (#39418733)
Your 200 line TCP proxy is likely to be very inefficient.

This is what things like DPDK and io_uring attempt to solve.

Re:Basic proxy implementation using io_uring by sophacles on Sunday February 18, 2024 @09:35AM (#39419392)
So your 200 line proxy... I wonder how it performs compared to this. Since LOC is a silly measure of anything, lets use it further: How many bytes/s/sloc does yours acheive compared to the io_uring one?
Re:Basic proxy implementation using io_uring by Fischgericht on Sunday February 18, 2024 @10:04AM (#39419608)
Or people have no respect for arrogant boasting.

Also, you most likely are a liar. Just the matrix tables you need for MPEG-1 are 500+ lines.

Unless of course you used 1100 lines to call ffmpeg. Then you don't need the tables.

But that being said: Yes, writing a TCP proxy in 200 lines is indeed possible. But it will use standard socket calls. You might want to read up about what io_uring is all about, and why it's worth going the extra mile.

Or, as an alternative, you could STFU :)