Sign in to follow this  
Followers 0
jaydeep

TCPconnect question

7 posts in this topic

i have made a program which can allow to remotely control your computer via the internet from any place...the problem is that i connect to the internet via a wireless network which is subnetted from a common ip...

like my ip is 111.231.213.124

and after subnetting it becomes... 192.168.1.2

so whenever i try to connect to my comoputer, iam unable to reach it..because the subnetted ip is local to the wireless network ..also if i try to connect to the main ip.. then also iam unable to do so...

please tell me about a way to connect to my computer in this case via tcp...

Share this post


Link to post
Share on other sites



Port forwarding.

Google the term if you don't know how or what.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

please elaborate how iam going to use that in autoit

Share this post


Link to post
Share on other sites

Show some progress.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

sir its basic..gui based tcp connection with simple codes... here is the code...

#include <GUIConstantsEx.au3>
#include <GUIStatusBar.au3>

$mainwindow=GUICreate("remote pc controller",500, 300)
$button1=GUICtrlCreateButton("CDTrayopen",30,50,60)
$button2=GUICtrlCreateButton("CDTrayclose",100,50,60)
$button3=GUICtrlCreateButton("connect",180,50,60)
$button4=GUICtrlCreateButton("disconnect",260,50,60)
$status= _GUICtrlStatusBar_Create($mainwindow)
$Input1 = GUICtrlCreateInput("give ip here",50,100,100,20)
_GUICtrlStatusBar_SetText($status,@IPAddress1)

GUISetState(@SW_SHOW)

While 1
    _GUICtrlStatusBar_SetText($status,@IPAddress1)
    $msg=GUIGetMsg()
    If $msg=$button3 then
        $ip=GUICtrlRead($Input1)
        TCPStartup()
        $port=1000
        $connectedsocket=TCPConnect($ip,$port)
        If @error Then
            _GUICtrlStatusBar_SetText($status,"cant connect check ip or connection")
            sleep(1000)
            
        Else
            _GUICtrlStatusBar_SetText($status,"connected")
            while 1
                _GUICtrlStatusBar_SetText($status,"connected to "&$ip)
                $msg2=GUIGetMsg()
                If $msg2=$button1 Then
                    TCPSend($connectedsocket,"1")
                    
                    _GUICtrlStatusBar_SetText($status,"send command 1")
                    sleep(1000)
                
                EndIf
                
                If $msg2=$button2 Then
                    TCPSend($connectedsocket,"2")
                    
                    _GUICtrlStatusBar_SetText($status,"sent command 2")
                   sleep(1000)
                EndIf
            
                If $msg2=$button4 Then
                    TCPSend($connectedsocket,"3")
                    sleep(1000)
                    ;TCPShutdown()
                    
                    _GUICtrlStatusBar_SetText($status,"disconnected")
                    sleep(1000)
                    ExitLoop
                EndIf
            WEnd
        EndIf
    EndIf
        
        If $msg= -3 Then
         Exit
        EndIf
                
        
WEnd

u just enter the ip and connect ...

it works well on a normal internet connection but in case of a subnetted ip from a main network /...like a wireless internet connection.., it is not able to connect... which is relevant since here all computer share a local main ip... which is subnetted...

Share this post


Link to post
Share on other sites

Jay is talking about port forwarding on your router.

Share this post


Link to post
Share on other sites

Your wireless router has a web page for configuration. Point a browser to http://192/168.1.1 and configure forwarding of the TCPConnect "port" to 192.168.1.2

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

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  
Followers 0