Send Message in LAN
-
Hello. I am creating two application in C# one is for send message to another IP of my LAN. One that given IP i have another application in C# which is to receive that Message. I am using Socket Programming but getting error Doing like this... http://www.c-sharpcorner.com/uploadfile/dottys/socketprogdtrp11222005023030am/socketprogdtrp.aspx suggest me... shafiq
-
Hello. I am creating two application in C# one is for send message to another IP of my LAN. One that given IP i have another application in C# which is to receive that Message. I am using Socket Programming but getting error Doing like this... http://www.c-sharpcorner.com/uploadfile/dottys/socketprogdtrp11222005023030am/socketprogdtrp.aspx suggest me... shafiq
Judging by the responses to that article, I'd run fast and far from that site. I appears to be populated by idiots. First off, at least tell us what error you're getting from your code. It's very likely that someone here has already seen the same message and knows what it takes to fix it. If not, at least it will provide a clue to the solution. "getting error" tells us nothing. Secondly, spend some time browsing the articles here at CodeProject about socket communications. The articles here are written by professionals, are peer-reviewed, and cover a vast array of different approaches and solutions to common and unique problems. You will very likely find the solution simply by comparing your code to something already posted here. Good luck! :-D
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
-
Judging by the responses to that article, I'd run fast and far from that site. I appears to be populated by idiots. First off, at least tell us what error you're getting from your code. It's very likely that someone here has already seen the same message and knows what it takes to fix it. If not, at least it will provide a clue to the solution. "getting error" tells us nothing. Secondly, spend some time browsing the articles here at CodeProject about socket communications. The articles here are written by professionals, are peer-reviewed, and cover a vast array of different approaches and solutions to common and unique problems. You will very likely find the solution simply by comparing your code to something already posted here. Good luck! :-D
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
Hey Roger Wright.. Thnk for relpy, actually i dont have any knowledge about how to send data from one application to another over LAN or another application on same machine. So i copied and paste that article code. But getting error........ Only one usage of each socket address (protocol/network address/port) is normally permitted. Regards... Shafiq
-
Hey Roger Wright.. Thnk for relpy, actually i dont have any knowledge about how to send data from one application to another over LAN or another application on same machine. So i copied and paste that article code. But getting error........ Only one usage of each socket address (protocol/network address/port) is normally permitted. Regards... Shafiq
Shafiq4Code wrote:
actually i dont have any knowledge about how to send data from one application to another over LAN or another application on same machine.
May I suggest you spend some time learning the subject before trying to implement some code that you cannot understand. There are many articles here on CodeProject that will give good explanations as well as source code. There are also lots of good learning resources on the internet that you should be able to find via Google.
It's time for a new signature.
-
Shafiq4Code wrote:
actually i dont have any knowledge about how to send data from one application to another over LAN or another application on same machine.
May I suggest you spend some time learning the subject before trying to implement some code that you cannot understand. There are many articles here on CodeProject that will give good explanations as well as source code. There are also lots of good learning resources on the internet that you should be able to find via Google.
It's time for a new signature.
-
The .NET Sockets[^] class is a good starting point. As I said before you should look at some of the networking articles here on CodeProject, there are some excellent examples which contain both code and explanations.
It's time for a new signature.
-
Hey Roger Wright.. Thnk for relpy, actually i dont have any knowledge about how to send data from one application to another over LAN or another application on same machine. So i copied and paste that article code. But getting error........ Only one usage of each socket address (protocol/network address/port) is normally permitted. Regards... Shafiq
Check this article [^] at MSDN for details about the TCPClient class, and browse the related links for more information. The code you copied uses port 10 on both computers; since ports 0 - 1023 are Well Known Ports defined by IANA here[^], you should avoid them. It's possible that on one or both machines, port 10 is already in use. The combination of IP address and port may only be used once per machine. The IANA link also defines which port numbers are available for general use. Pick your port numbers from that list.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"