is it possible to send data from remote object to the server in C# remoting using TCP channel????

Please reply

thanking you in advance....................

Dani AI

Generated

For — short, practical summary plus pointers.

Yes. .NET Remoting can send data over a TCP channel (clients call server methods) and can also support server-to-client callbacks by passing a MarshalByRefObject reference and having the client open a listening TcpChannel. That pattern is the classic Remoting approach (server-activated or client-activated objects + TcpChannel). (learn.microsoft.com)

Practical notes (common pitfalls you’ll hit):

  • To accept callbacks the client must register a channel that listens (use port 0 to let the OS pick a free port).
  • Remote objects use leases; override InitializeLifetimeService or use a sponsor to avoid objects being garbage-collected unexpectedly.
  • Binary formatter / full deserialization is dangerous for exposed endpoints — avoid it for production and prefer safe serializers.
    Example (very small, demo-only):
    ChannelServices.RegisterChannel(new TcpChannel(0), false); // client listens on any free port
    public override object InitializeLifetimeService() => null; // demo only — controls lease

    See the remoting/lease details and the BinaryFormatter security guidance. (learn.microsoft.com)

About WCF (as suggested): WCF’s netTcpBinding supports duplex contracts (server callbacks) and is generally a cleaner, better-supported way to implement two‑way TCP-style communication. WCF services may be self-hosted inside a managed app (WinForms, console) or run as a Windows Service if you need a background host. If the app is on .NET Framework, WCF is the usual migration path from Remoting. (learn.microsoft.com)

Important decision factor: .NET Remoting is legacy and effectively obsoleted for modern .NET (it’s not supported on .NET 5+), so prefer WCF (Framework) or modern alternatives (gRPC / SignalR / REST) for new work. Use Remoting only for maintenance on an existing .NET Framework deployment and pay close attention to security (serialization, ports, firewall/NAT). (learn.microsoft.com)

Summary for the thread: Remoting + TcpChannel can do it (including callbacks) but requires careful lease/port and security handling; WCF duplex or a modern stack is a safer choice for new projects.

ya..with the help of WCF..it is possible...

refer above link ..

Is it Possible with C# Windows Forms Application in Visual Studio

ya..with the help of Windows Service..u can make the WCF(Windows Service) 4 desktop application..

refer this may be this link helpful 2 u..

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.