Hola Antonio,
Supongo que es una prueba de concepto. Ejecuto testrv2.exe, escribo en el get y asi ocurre. En todo caso impresiona tener un .exe funcionando como un servidor de pantallas.
Salu2
Dear Antonio ,
Thanks a lot for these .EXEs. I tried them and its working in the browsers but it seems that only one user can run the exe because when I interacting to the application via browser the same operation also on .EXEs behavior. If two users interacts with the same .EXE what will happen ?
We use Harbour threads to attend different users from the same EXE doing different tasks:
testrvmulti.prg
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
// Remote View multi-cliente con UNA VENTANA POR CLIENTE + MONITOR.
//
// Cada cliente tiene su PROPIA ventana, en su propio hilo y puerto, con su
// propio estado (contador de clicks). La ventana principal es un MONITOR que
// muestra en vivo todos los clientes (puerto y clicks).
//
// http://localhost:8080 -> ventana del cliente 1
// http://localhost:8081 -> ventana del cliente 2
// ...
//
// Reparto de responsabilidades:
// - GUI en UN SOLO hilo (el principal). FiveWin no es seguro con GUI en
// varios hilos a la vez, asi que TODAS las ventanas viven aqui. Cada
// "ventana de cliente" es un DIALOGO MODELESS (ACTIVATE DIALOG NOWAIT),
// bombeado por el loop de la ventana monitor.
// - SERVING en N hilos: un hilo por dialogo con RemoteViewServe() sobre su
// propio puerto. Estado del server aislado por TLS.
//
// Requiere la VM multihilo: build_new.bat testrvmulti mt
//----------------------------------------------------------------------------//
#define N_CLIENTS 3
#define BASE_PORT 8080
// Contadores de clicks por cliente (compartidos: el ACTION de cada dialogo los
// incrementa, el monitor los lee).
STATIC s_aClicks
FUNCTION Main()
local oMon, oTimer
local aDlg := {}
local aSay := {}
local oSay
local i
s_aClicks := Array( N_CLIENTS )
AFill( s_aClicks, 0 )
// 1. Crear las N ventanas-cliente (dialogos modeless) en ESTE hilo.
for i := 1 TO N_CLIENTS
AAdd( aDlg, OpenClientDlg( i, BASE_PORT + i - 1 ) )
next
// 2. Un hilo de serving por ventana, cada uno en su puerto.
for i := 1 TO N_CLIENTS
hb_threadStart( {| h, p | RemoteViewServe( h, p, 200, 200 ) }, ;
aDlg[ i ]:hWnd, BASE_PORT + i - 1 )
next
// 3. Ventana principal = MONITOR de clientes. Su loop bombea los dialogos.
DEFINE WINDOW oMon TITLE "Remote View - Monitor de clientes" FROM 2, 2 TO 15, 54
@ 0.4, 2 SAY "Cliente Puerto Clicks" OF oMon SIZE 360, 18
for i := 1 TO N_CLIENTS
@ 1.2 + i * 1.1, 2 SAY oSay PROMPT "" OF oMon SIZE 360, 18
AAdd( aSay, oSay )
next
// Refresco en vivo del monitor desde los contadores compartidos.
DEFINE TIMER oTimer OF oMon INTERVAL 400 ACTION RefreshMonitor( aSay )
ACTIVATE WINDOW oMon ;
ON INIT ( oTimer:Activate(), RefreshMonitor( aSay ) ) ;
VALID ( RemoteViewStopAll(), AEval( aDlg, {| o | o:End() } ), .T. )
RETURN NIL
//----------------------------------------------------------------------------//
STATIC FUNCTION RefreshMonitor( aSay )
local i
for i := 1 TO Len( aSay )
aSay[ i ]:SetText( " " + Str( i, 3 ) + " " + ;
LTrim( Str( BASE_PORT + i - 1 ) ) + " " + ;
LTrim( Str( s_aClicks[ i ] ) ) )
next
RETURN NIL
//----------------------------------------------------------------------------//
// Crea un dialogo modeless que hace de "ventana" de un cliente, con su propio
// contador de clicks (estado independiente, monitorizado por la principal).
//----------------------------------------------------------------------------//
STATIC FUNCTION OpenClientDlg( nIdx, nPort )
local oDlg, oSay, oBtn
DEFINE DIALOG oDlg ;
TITLE "Cliente " + LTrim( Str( nIdx ) ) + " - puerto " + LTrim( Str( nPort ) ) ;
SIZE 280, 130 PIXEL
@ 12, 12 SAY oSay PROMPT "Clicks: 0" SIZE 240, 18 PIXEL OF oDlg
@ 44, 12 BUTTON oBtn PROMPT "Pulsa" ;
SIZE 80, 12 PIXEL OF oDlg ;
ACTION ( s_aClicks[ nIdx ]++, ;
oSay:SetText( "Clicks: " + LTrim( Str( s_aClicks[ nIdx ] ) ) ) )
// Modeless: se crea y muestra, pero NO bloquea; lo bombea el loop del
// monitor. Lo escalonamos en pantalla para que no se solapen.
ACTIVATE DIALOG oDlg NOWAIT ;
ON INIT oDlg:Move( 20 + nIdx * 40, 20 + nIdx * 60, , , .T. )
RETURN oDlg
//----------------------------------------------------------------------------//Hello,
Does this class work like AnyDesk?
If so, how do I connect via the internet? Just by providing the IP address?
Thanks.
Dear Ari,
It is not an Anydesk replacement
You should test the examples to get a better idea of its possibilites :idea: