Jump to content
Sign in to follow this  
Alexxander

TCP listen and TCP accept for any IP ?

Recommended Posts

Alexxander

hi all

i am making a script that u run a script on a PC and then send a shutdown command from another PC from another script through the internet

i'am using TCP functions

the problem is that i only know the IP address of the PC that will receive the command 

and when i want to use the TCP listen i and TCP accept i have to specify the ip to listen for (wich i don't have)

 

can i make the receiver PC listen to all IPs at a specified port ?

tnx in advanced...

Edited by alexander95

Share this post


Link to post
Share on other sites
FireFox

Hi,

For the TCPListen function use the @IPAddress1 macro.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Alexxander
Jos

 

i'm sorry i don't understand what u mean 

u didn't understand the idea i'm talking about ? 

u want me to retell it with another words ?


Share this post


Link to post
Share on other sites
Alexxander
FireFox

 

bro: @IPAddress1 macro it give the local IP i am sending the command through the internet wich i must use the Global IP


Share this post


Link to post
Share on other sites
hannes08

FireFox

 

bro: @IPAddress1 macro it give the local IP i am sending the command through the internet wich i must use the Global IP

You cannot listen to the global IP as it belongs to your local router.

You also need to create a port forwarding on that device in order to make this working.

Or a third party server in the middle where both PCs can connect to to receive the commands.

  • Like 1

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites
FireFox

bro

Who is bro?

 

@IPAddress1 macro it give the local IP i am sending the command through the internet wich i must use the Global IP

You don't understand how it works, the server listens for incomming connections so it uses its local IP.

 

You cannot listen to the global IP as it belongs to your local router.

It depends on how your network is made, but yes it's not a global IP for the individuals.

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Jos

Jos

i'm sorry i don't understand what u mean 

u didn't understand the idea i'm talking about ? 

u want me to retell it with another words ?

The problem is that you are not making clear what you want to do so I asked you to explain it better.

Your title says you want to listen on any IP, but you clearly do not understand how this works when being on an LAN behind a LAT router connected to the internet.

So define clearly what you you want to do and you might get some better explanations and help.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Alexxander

Posted 4 minutes ago

alexander95, on 28 Aug 2013 - 12:56 PM, said:snapback.png

bro

Who is bro?

 

(bro) is a shortcut for (brother) , anyway i meant by saying it (my friend)


Share this post


Link to post
Share on other sites
FireFox

(bro) is a shortcut for (brother) , anyway i meant by saying it (my friend)

Actually I know that, I made you believe I didn't know :) Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Alexxander

Actually I know that, I made you believe I didn't know :)

genius-meme.png


Share this post


Link to post
Share on other sites
FireFox

Your problem is solved?

If not, try the TCP examples of the beta helpfile.

Replace the server script IP by @IPAddress1 and the client script IP by the global IP of the server.

Br, FireFox.

  • Like 1

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
EKY32

I think he needs to make all the clients connect to one server or a database with the IP Addresses of the servers.

Edited by EKY32

[font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×