Regarding Winsock control
-
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.
-
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.
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 -
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 -
Unless he wants to connect directly to the client, without using a central server ;)
Motivation is the key to software development.
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 -
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, 2008Indeed, 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.
-
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.
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 -
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, 2008Hi 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
-
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
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()
andGetHostByName().
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, ZaegraMotivation is the key to software development.
-
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
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