Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Send Message in LAN

Send Message in LAN

Scheduled Pinned Locked Moved C#
csharpcomhelp
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ShafiqA
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • S ShafiqA

      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

      R Offline
      R Offline
      Roger Wright
      wrote on last edited by
      #2

      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"

      S 1 Reply Last reply
      0
      • R Roger Wright

        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"

        S Offline
        S Offline
        ShafiqA
        wrote on last edited by
        #3

        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

        L R 2 Replies Last reply
        0
        • S ShafiqA

          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

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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.

          S 1 Reply Last reply
          0
          • L Lost User

            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.

            S Offline
            S Offline
            ShafiqA
            wrote on last edited by
            #5

            Thanks for reply Can u please suggest me what thing i need to learn to accomplish this.

            L 1 Reply Last reply
            0
            • S ShafiqA

              Thanks for reply Can u please suggest me what thing i need to learn to accomplish this.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • S ShafiqA

                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

                R Offline
                R Offline
                Roger Wright
                wrote on last edited by
                #7

                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"

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups