Click here to Skip to main content
15,867,939 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
I have created an application in which i created some objects on run time.

For eg. I have a form in which i created some text-box at run time and assign some values to these text-boxes.

I want to pass these objects to same application running on Other computer on LAN.
How can i do this? I have never used R emoting, Socket Programing etc.
Can anyone provide me a simple example for this or any guidance? Thanks.
Posted

Yes you can create this check this example
Multi-threaded Client/Server Socket Class[^]
 
Share this answer
 
Comments
Maciej Los 15-May-12 16:32pm    
Good link, my 5!
You can use the following levels: low sockets level using System.Net.Sockets.Socket, a little higher socket levels using System.Net.Sockets.UdpClient (UDP), System.Net.Sockets.TcpListener/System.Net.Sockets.TcpClient (TCP), .NET remoting, WCF (self-hosted or not).

Lower levels will need Marshaling and/or Serialization; you may also need to know how to create and use DataContract and/or ServiceContract, especially with WCF. One of the most essential aspects will be threading and thread synchronization.

I would suggest you don't try to communicate between applications (it depends on your goal though). It's usually more productive to think in terms of service (not necessarily client-server) and clients.

Making even most elementary examples on every level would make a really big article, may be… hard to estimate… some tens of pages. Who will write it for you? Better try to find articles of separate topic in CodeProject and create prototype applications using each technique. Only in this way you will be able to feel them well enough to decide on designs on your applications.

Basic advice: don't try to send UI controls and the like, like some do. Create pure-data types and send pure data; create loose coupling between data and UI, isolate UI from data model, universal functionality and application-specific functionality.

—SA
 
Share this answer
 
Comments
Maciej Los 15-May-12 16:32pm    
Good answer, my 5!
Sergey Alexandrovich Kryukov 15-May-12 17:29pm    
Thank you,
--SA
Darknalk 25-Dec-14 12:27pm    
Thank you, but Is there also an example for better understanding ? Sample Program
Sergey Alexandrovich Kryukov 25-Dec-14 14:59pm    
It would need considerable time to write one. Unfortunately, I already have a queue of unpublished articles to finalize, much less time for that, and the article on network communication would have the very least priority. You can find enough samples if you use words from my answer as keywords for search. Besides, it's not to hard to start with writing code from scratch.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900