LionSpain Posted January 5, 2019 Share Posted January 5, 2019 (edited) The problem is when i click Enviar(Send) msgbox no send client, and show msgbox in Server i dont know why Server Code: Case $URL ;Actualizar Local $sSelected = _ItemSelect() TCPSend($sConections[$sSelected][0], 'URL') _DownURL() Func _DownURL() #region ### START Koda GUI section ### $FormURL = GUICreate("server ", 451, 109, 588, 457) $actualizacion = GUICtrlCreateInput("Motivo Actualizacion", 0, 0, 449, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER)) $sUser = GUICtrlCreateInput("USER", 0, 24, 449, 21) $MotivoActualizado = GUICtrlCreateInput("Actualizado", 0, 48, 449, 21) $Pegar = GUICtrlCreateButton("Pegar", 0, 80, 41, 17) $Enviar = GUICtrlCreateButton("Enviar", 152, 80, 121, 17) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($FormURL) ExitLoop Case $Pegar GUICtrlSetData($MotivoActualizado, ClipGet()) Case $Enviar Local $sWEB = MsgBox(64, 'Server', GUICtrlRead($Actualizacion) & GUICtrlRead($Usuario) & GUICtrlRead($MotivoActualizado)) TCPSend($sConections[$sSelected][0], $sWEB) EndSwitch WEnd EndFunc Client Code: If $sacciones = "URL" Then TCPRecv($sConect, 2048) EndIf Edited January 5, 2019 by LionSpain Link to comment Share on other sites More sharing options...
Jefrey Posted January 9, 2019 Share Posted January 9, 2019 TCP can only send data, not call to functions. What your script is doing is sending the return value of the msgbox function to the server. Just think so: if all TCP servers could execute AutoIt3 functions, then we could connect to Facebook and call FileDelete() on everything You have to implement a client-server protocol, which your server sends something like "SHOWMSGBOX" (or any other arbitrary string/data) and the client receives it and knows that when it receives "SHOWMSGBOX", it must show a message box. In my signature you can take a look on TCPServer and TCPClient UDFs which brings a lot of examples and allow you to do it by controlling events. My stuff Spoiler My UDFs _AuThread multithreading emulation for AutoIt · _ExtInputBox an inputbox with multiple inputs and more features · forceUTF8 fix strings encoding without knowing its original charset · JSONgen JSON generator · _TCPServer UDF multi-client and multi-task (run on background) event-based TCP server easy to do · _TCPClient_UDF multi-server and multi-task (runs on background) event-based TCP client easy to do · ParseURL and ParseStr functions ported from PHP · _CmdLine UDF easily parse command line parameters, keys or flags · AutoPHP Create documents (bills, incomes) from HTML by sending variables/arrays from AutoIt to PHP · (Un)Serialize Convert arrays and data into a storable string (PHP compatible) · RTTL Plays and exports to MP3 Nokia-format monophonic ringtones (for very old cellphones) · I18n library Simple and easy to use localization library · Scripting.Dictionary OOP and OOP-like approach · Buffer/stack limit arrays to N items by removing the last one once the limit is reached · NGBioAPI UDF to work with Nitgen fingerprint readers · Serial/Licensing system require license key based on unique machine ID from your users · HTTP a simple WinHTTP library that allows GET, POST and file uploads · Thread true AutoIt threads (under-dev) · RC4 RC4 encryption compatible with PHP and JS · storage.au3 localStorage and sessionStorage for AutoIt Classes _WKHtmlToX uses wkhtmlto* to convert HTML files and webpages into PDF or images (jpg, bmp, gif, png...) Snippets _Word_DocFindReplaceByLongText replace strings using Word UDF with strings longer than 255 characters (MSWord limit) rangeparser parser for printing-like pages interval (e.g.: "1,2,3-5") EnvParser parse strings/paths with environment variables and get full path GUICtrlStaticMarquee static text scrolling Random stuff Super Mario beep sound your ears will hurt Link to comment Share on other sites More sharing options...
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