I'm looking for a DLL or a complete C# project with Client and server for sending and receiving XML-document. Google isn't my friend :(

I'm thankful for any help!

Dani AI

Generated

decided to move from raw async sockets to a WebService — a sensible switch depending on priorities. ’s pointers to async sockets are a valid route when you need a custom, low-latency or long-lived binary protocol, but HTTP-based services win on interoperability, firewall/proxy friendliness and easier hosting. Choose by answering: do you need raw performance/streaming (sockets) or easier integration and simpler deployment (WebService/HTTP)?

Practical points missed in the thread that matter in either approach:

  • Message framing: never assume a single Receive yields a whole XML document. Use a length prefix, a clear delimiter, or rely on HTTP Content-Length/chunking so the receiver knows when the XML is complete.
  • Encoding and parsing: standardize on an encoding (UTF-8) and honor the XML declaration. Disable DTD processing to avoid XXE attacks (XmlReaderSettings.DtdProcessing = Prohibit).
  • Partial reads and buffering: buffer and assemble partial packets before parsing; validate against an XSD before acting on content.
  • Scalability and safety: for raw sockets prefer async patterns (avoid one thread per connection), reuse buffers and pools to reduce GC pressure, and protect traffic with TLS (SslStream). See high-performance socket patterns in the platform docs for guidance.
  • If you go WebService: use HTTPS, pick REST or WCF based on needs, enable streaming for large payloads, and increase message-size limits/timeouts appropriately. For duplex or server push consider WebSockets/SignalR.

Quick checklist for next steps: pick transport, design framing or use HTTP, enforce encoding & schema validation, enable TLS, and load-test in realistic network conditions. For implementation patterns see the platform async-socket guidance and the ASP.NET Web API docs:
SocketAsyncEventArgs docs
ASP.NET Core Web API docs

Recommended Answers

All 2 Replies

Take a look at :

1.
2.
2.

Take a look at :

1.
2.
2.

Thanks! After some reading I decided to take a different path, I'ill try to build a WebService instead.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.