Handling a raw tcp inside asp.net - Postgresql wire protocol server in c# #53024
-
I'm experimenting with implementing the PgSQL wire protocol (server side) in C#, currently the server side is hosted in a console application with a TCP Listener.
Using the references of https://gavinray97.github.io/blog/postgres-wire-protocol-jdk-21 and the excellent documentation of the Postgresql wire protocol https://www.postgresql.org/docs/current/protocol.html and https://www.postgresql.org/docs/current/protocol-message-formats.html, I implemented here a C# minimal console application that responds to a command line psql query. How can I put this into ASP.NET? Can I benefit from some of the functionality of asp.net while intercepting the raw tcp data and processing it manually? Is there something I can plug into the pipeline for processing? This would enable hosting this postgresql server endpoint next to my rest apis. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
You can use a custom ConnectionHandler. An (older) example that shows how to use that type is given in MultiProtocolAspNetCore Besides that: are you aware of Npgsql? |
Beta Was this translation helpful? Give feedback.
You can use a custom ConnectionHandler. An (older) example that shows how to use that type is given in MultiProtocolAspNetCore
Besides that: are you aware of Npgsql?