JFee Posted July 15, 2008 Posted July 15, 2008 (edited) I am writing a set of a few programs that will be run on separate computers on the same network and communicate via TCP. I have a server that does all of the receiving, and 2 controllers that send messages. For the controllers, the user enters the IP of the server at startup, which is fine because the Server IP may be different each time, but I do not want to have to do that for the server. I would like to automatically determine the local IP and use that as the IP it listens on. Is there any way to do this? I am not sure where to start... Edited July 15, 2008 by JFee Regards,Josh
DaRam Posted July 15, 2008 Posted July 15, 2008 Macro @IPAddress1 ;IP address of first network adapter.@IPAddress2 ;IP address of second network adapter. Returns 0.0.0.0 if not applicable. I am writing a set of a few programs that will be run on separate computers on the same network and communicate via TCP.I have a server that does all of the receiving, and 2 controllers that send messages. For the controllers, the user enters the IP of the server at startup, which is fine because the Server IP may be different each time, but I do not want to have to do that for the server. I would like to automatically determine the local IP and use that as the IP it listens on.Is there any way to do this? I am not sure where to start...
JFee Posted July 15, 2008 Author Posted July 15, 2008 Hmm... but how do I know which is the current computer? This would be good if I was connecting to the same computer every time, but I can't find out the current one by this. Regards,Josh
weaponx Posted July 15, 2008 Posted July 15, 2008 Hmm... but how do I know which is the current computer? This would be good if I was connecting to the same computer every time, but I can't find out the current one by this.What are you talking about? @IPAddress1 always returns the IP of the computer the script is running from.
JFee Posted July 15, 2008 Author Posted July 15, 2008 Woah, my bad. I was misreading the helpfile. Thought it was referring to the first IP on the LAN Regards,Josh
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now