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. Visual Basic
  4. two UDP socket on the same machine..

two UDP socket on the same machine..

Scheduled Pinned Locked Moved Visual Basic
sysadminhelpquestion
7 Posts 5 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.
  • J Offline
    J Offline
    jainiraj
    wrote on last edited by
    #1

    I have an application "app1" which create a UDP socket with port no. 6677.This app broadcast a data packet. I hav another application "app2" which also create UDP socke which always listen 6677.Whenever the data packet comes it do certain operations. Now problem is , when I run these to apps on different machines in the network, app2 detects the data packet.But when I run both the applications on the same machine,app2 never detects the data packet. What may e the problem??? UDP socket related code in app2 is pasted here.... wsClientRecieve.RemotePort = 6677 wsClientRecieve.RemoteHost = "127.0.0.1" wsClientRecieve.LocalPort = 6677 wsClientRecieve.Bind 6677 Thanks in adv..

    L D M 3 Replies Last reply
    0
    • J jainiraj

      I have an application "app1" which create a UDP socket with port no. 6677.This app broadcast a data packet. I hav another application "app2" which also create UDP socke which always listen 6677.Whenever the data packet comes it do certain operations. Now problem is , when I run these to apps on different machines in the network, app2 detects the data packet.But when I run both the applications on the same machine,app2 never detects the data packet. What may e the problem??? UDP socket related code in app2 is pasted here.... wsClientRecieve.RemotePort = 6677 wsClientRecieve.RemoteHost = "127.0.0.1" wsClientRecieve.LocalPort = 6677 wsClientRecieve.Bind 6677 Thanks in adv..

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      I don't know the answer to your problem, however, I always start by asking myself: would I be the only one with such a problem? when not, I try google[^]. There sure are some interesting hits, such as this one[^]. Good hunting! :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

      Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

      1 Reply Last reply
      0
      • J jainiraj

        I have an application "app1" which create a UDP socket with port no. 6677.This app broadcast a data packet. I hav another application "app2" which also create UDP socke which always listen 6677.Whenever the data packet comes it do certain operations. Now problem is , when I run these to apps on different machines in the network, app2 detects the data packet.But when I run both the applications on the same machine,app2 never detects the data packet. What may e the problem??? UDP socket related code in app2 is pasted here.... wsClientRecieve.RemotePort = 6677 wsClientRecieve.RemoteHost = "127.0.0.1" wsClientRecieve.LocalPort = 6677 wsClientRecieve.Bind 6677 Thanks in adv..

        D Offline
        D Offline
        DaveAuld
        wrote on last edited by
        #3

        jainiraj wrote:

        two UDP socket on the same machine..

        Damn, i thought this was the start of a Joke and was waiting for the punchline. :)

        Dave Find Me On: Web|Facebook|Twitter|LinkedIn My Latest Article: ESD System Communication Failure Fail Safe Software Implementation

        L 1 Reply Last reply
        0
        • D DaveAuld

          jainiraj wrote:

          two UDP socket on the same machine..

          Damn, i thought this was the start of a Joke and was waiting for the punchline. :)

          Dave Find Me On: Web|Facebook|Twitter|LinkedIn My Latest Article: ESD System Communication Failure Fail Safe Software Implementation

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          There once were two UDP sockets entering a bar. The bar tender says... I don't know any socket jokes, sorry. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

          _ 1 Reply Last reply
          0
          • J jainiraj

            I have an application "app1" which create a UDP socket with port no. 6677.This app broadcast a data packet. I hav another application "app2" which also create UDP socke which always listen 6677.Whenever the data packet comes it do certain operations. Now problem is , when I run these to apps on different machines in the network, app2 detects the data packet.But when I run both the applications on the same machine,app2 never detects the data packet. What may e the problem??? UDP socket related code in app2 is pasted here.... wsClientRecieve.RemotePort = 6677 wsClientRecieve.RemoteHost = "127.0.0.1" wsClientRecieve.LocalPort = 6677 wsClientRecieve.Bind 6677 Thanks in adv..

            M Offline
            M Offline
            MikeD 2
            wrote on last edited by
            #5

            Ok, I have done something similar and got it working I "think" the answer is that your localport on the "client" app should be 0 to allow it to use another port to connect from, I use .connect rather than .bind, I don't know enough to say whether this is because I am using vb6 basically only one process can create/bind port 6677 on a given PC and other processes have to connect to it. If you are indeed trying to create the socket in both processes the second create should fail

            1 Reply Last reply
            0
            • L Luc Pattyn

              There once were two UDP sockets entering a bar. The bar tender says... I don't know any socket jokes, sorry. :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

              Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

              _ Offline
              _ Offline
              _Erik_
              wrote on last edited by
              #6

              The first one said: - Hey, man, yesterday I asked Mary to marry me. - And what did she say? - Errr... I don't even know if she was listening... Yep, this is UDP.

              L 1 Reply Last reply
              0
              • _ _Erik_

                The first one said: - Hey, man, yesterday I asked Mary to marry me. - And what did she say? - Errr... I don't even know if she was listening... Yep, this is UDP.

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                That is why SMS is more suited for the occasion I guess. :thumbsup:

                Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                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