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. Regarding Winsock control

Regarding Winsock control

Scheduled Pinned Locked Moved Visual Basic
sysadminhelplounge
9 Posts 3 Posters 1 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
    specialdreamsin
    wrote on last edited by
    #1

    Hi, I am using Winsock control in Visual Basic 6.0. I am writing a application to chat with local network users. So on form load it has to get all ip addresses or machine names connected to my system. Please help me out. Ramesh Sambari

    Knowledge is like honey. Collect it, to make life sweet.

    D 1 Reply Last reply
    0
    • S specialdreamsin

      Hi, I am using Winsock control in Visual Basic 6.0. I am writing a application to chat with local network users. So on form load it has to get all ip addresses or machine names connected to my system. Please help me out. Ramesh Sambari

      Knowledge is like honey. Collect it, to make life sweet.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      specialdreamsin wrote:

      So on form load it has to get all ip addresses or machine names connected to my system.

      Why?? What's it going to do with those addresses?? This is a chat application. All it needs to know is the IP address of a central chat server, or the server exposed by another copy of your application running on another system.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      Z S 2 Replies Last reply
      0
      • D Dave Kreskowiak

        specialdreamsin wrote:

        So on form load it has to get all ip addresses or machine names connected to my system.

        Why?? What's it going to do with those addresses?? This is a chat application. All it needs to know is the IP address of a central chat server, or the server exposed by another copy of your application running on another system.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        Z Offline
        Z Offline
        Zaegra
        wrote on last edited by
        #3

        Unless he wants to connect directly to the client, without using a central server ;)

        Motivation is the key to software development.

        D 1 Reply Last reply
        0
        • Z Zaegra

          Unless he wants to connect directly to the client, without using a central server ;)

          Motivation is the key to software development.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          What's he going to do?? Port scan every machine in the network looking for clients?? It's possible to do with advertising broadcasts, so long as they're not being blocked at the routers/switches. But, this is not trivial to implement.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          Z 1 Reply Last reply
          0
          • D Dave Kreskowiak

            What's he going to do?? Port scan every machine in the network looking for clients?? It's possible to do with advertising broadcasts, so long as they're not being blocked at the routers/switches. But, this is not trivial to implement.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            Z Offline
            Z Offline
            Zaegra
            wrote on last edited by
            #5

            Indeed, too many "ifs". Your solution is probably the best one in this situation. One central server which distributes chatting traffic to the other clients, preferably using UDP instead of TCP, since the computers are directly connected through LAN. But since he's not responding to your message, I think he found a solution. Always nice to know people respect your help, isn't it :omg:

            Motivation is the key to software development.

            D 1 Reply Last reply
            0
            • Z Zaegra

              Indeed, too many "ifs". Your solution is probably the best one in this situation. One central server which distributes chatting traffic to the other clients, preferably using UDP instead of TCP, since the computers are directly connected through LAN. But since he's not responding to your message, I think he found a solution. Always nice to know people respect your help, isn't it :omg:

              Motivation is the key to software development.

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Zaegra wrote:

              Always nice to know people respect your help, isn't it

              That's par around here. Very rarely do you get any response to anything if you have to ask the OP for additional information or even to say if the solution worked.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              1 Reply Last reply
              0
              • D Dave Kreskowiak

                specialdreamsin wrote:

                So on form load it has to get all ip addresses or machine names connected to my system.

                Why?? What's it going to do with those addresses?? This is a chat application. All it needs to know is the IP address of a central chat server, or the server exposed by another copy of your application running on another system.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                S Offline
                S Offline
                specialdreamsin
                wrote on last edited by
                #7

                Hi all, I am very much thankful to all of you for your reponse. But I am extremely sorry that It doesn't suite my requirement. What exactly I want is, I want to list out all the System Names connected to my system in the LAN only. Like My Network Places link on Desktop will show all systems in Windows. Ramesh Sambari

                Knowledge is like honey. Collect it, to make life sweet.

                modified on Friday, May 15, 2009 2:00 AM

                Z D 2 Replies Last reply
                0
                • S specialdreamsin

                  Hi all, I am very much thankful to all of you for your reponse. But I am extremely sorry that It doesn't suite my requirement. What exactly I want is, I want to list out all the System Names connected to my system in the LAN only. Like My Network Places link on Desktop will show all systems in Windows. Ramesh Sambari

                  Knowledge is like honey. Collect it, to make life sweet.

                  modified on Friday, May 15, 2009 2:00 AM

                  Z Offline
                  Z Offline
                  Zaegra
                  wrote on last edited by
                  #8

                  First of all, that makes your question a lot more specific. :) To (partially) answer your question: You can check when someone connects to your system. When it does (and you accept the connection), you have a socket adress. Now: You'll have to write a function that returns the computer name (on the client side), and sends it to your system using winsock. So immediately when the connection succeeds, the client sends his name to your pc. There is also another option, but I don't exactly know how to use it. Try searching for GetHostByIP() and GetHostByName(). As I said, I only know these functions exists, not how to use them, but it won't be so hard to figure out I guess ;) Cheers, Zaegra

                  Motivation is the key to software development.

                  1 Reply Last reply
                  0
                  • S specialdreamsin

                    Hi all, I am very much thankful to all of you for your reponse. But I am extremely sorry that It doesn't suite my requirement. What exactly I want is, I want to list out all the System Names connected to my system in the LAN only. Like My Network Places link on Desktop will show all systems in Windows. Ramesh Sambari

                    Knowledge is like honey. Collect it, to make life sweet.

                    modified on Friday, May 15, 2009 2:00 AM

                    D Offline
                    D Offline
                    Dave Kreskowiak
                    wrote on last edited by
                    #9

                    You can scan the network for machines connected to the same network, but this is a very time consuming process. "Connected to your system" doesn't really mean anything because the only thing that would normally be "connected to your system" would be servers doing inventories, checking for updates, and intalling software and updates.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007, 2008

                    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