Sign in to follow this  
Followers 0
Kyme

tcp ip small question (client-server)

2 posts in this topic

#1 ·  Posted (edited)

hello there,

it's not quite right forum to ask, but it use autoit that's why i ask here, most of it i will find it quicker answare here then on php/html forums

well, lets start, i want to use and tcp ip conection based on server-client to control my winamp(like volum up, down, play, pause, stop, next e.t.c) that's easy to do it with an simple php script and and tool to check an field infinitely and search commands, but that make quite big delay between client-server so i ask myself what alternative i have, well, tcp ip it seems to be good one, but i'm not sure of something can i make an web server and use autoit client and control client through webpage?if yes, can somebody give me please some point where to start?no matter if it's autoit or php or both i just need to know

if it's possible in this way, or you can tell me some better way to don't have so big delay between server-client?all i have until now it's @3h

of work, and and done project(autoit&php) what use mysql to store comands

and it's look like inet an page with single post of mysql(command) if that file contain only "done"-> do nothing if contain other thing like winamp_play

it will call function winamp_play()

here's my script until now, the delay it's because of sql update using IE after done the command

commands are done by php script what update the command field with functions from autoit client what will be called after check

any better solution for this it is possible?

Edit: i forgot to say that i will be using mostly my domain not local connection, it's more easier(i already saw the mysql udf, i just can't config mysql server to accept external connection, don't know why, it refuse to work, so this one kinda fall)

#include <IE.au3>
#include <Winamp_Library.au3>


;~ MsgBox(0, "Form Element Value", $getcommand)
reload()

func reload()
while 1
Local $command = InetRead("http://localhost/remote/_update.php?view",1)
If BinaryToString($command) = "done" Then

Else
Call(BinaryToString($command))
$oIE = _IECreate("http://localhost/remote/_update.php?update=done",0,0,1,0)
_IEQuit($oIE)
EndIf
sleep(1000)
WEnd
EndFunc

Func winamp_play()
_Winamp_play()
TrayTip("Remote control","Winamp play/pause",5000)
EndFunc
Func winamp_stop()
_Winamp_Stop()
TrayTip("Remote control","Winamp stop",5000)
EndFunc
Func winamp_next()
_Winamp_Next()
TrayTip("Remote control","Winamp next",5000)
EndFunc
Func winamp_prev()
_Winamp_Previous()
TrayTip("Remote control","Winamp prev",5000)
EndFunc
Func winamp_volup()
$getvol=_Winamp_GetVolume()
_Winamp_SetVolume($getvol+26)

TrayTip("Remote control","Winamp Volume Up",5000)
EndFunc
Func winamp_volmin()
_Winamp_SetVolume(0)
TrayTip("Remote control","Winamp Volume Min",5000)
EndFunc
Func winamp_vol50()
_Winamp_SetVolume(128)
TrayTip("Remote control","Winamp Volume 50%",5000)
EndFunc
Func winamp_volmax()
_Winamp_SetVolume(255)
TrayTip("Remote control","Winamp Volume Max",5000)
EndFunc
Func winamp_voldown()
$getvol=_Winamp_GetVolume()
_Winamp_SetVolume($getvol-26)
TrayTip("Remote control","Winamp Volume Down",5000)
EndFunc
Func teamview()
Run("C:Program Files (x86)TeamViewerVersion7TeamViewer.exe")
TrayTip("Remote control","TeamViewer Started",5000)
EndFunc
Func teamviewkill()
ProcessClose("TeamViewer.exe")
TrayTip("Remote control","TeamViewer Killed",5000)
EndFunc
Func winampstart()
_Winamp_Start()
TrayTip("Remote control","Winamp Started",5000)
EndFunc
Edited by Kyme

Share this post


Link to post
Share on other sites



nvm, i just found an socket server udf with an php client, works amazing...that's really fast...i think i found what i need

thank you anyway

regards

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