I finally managed to connect sockserv to the sockcli
and creating an array I saw that when a client connects, it puts the socket number and its ip
as you can see in this picture
Now I wish send a message or a file to client but to a specific client
How I must make ?
I try to send data from server and it send only to the last connected oclient
wich is the command or function to send message to a specific oClient ?
send a data to a client
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
send a data to a client
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: send a data to a client
Silvio, can you post the code so far?. Thanks
Muchas gracias. Many thanks.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: send a data to a client
I use sockcli.prg and sockserv.prg U found them on samples folder
When a client is connetted to server I create an array with oClient:nSocket and oClient:ClientIP()
I 'am trying to understand How I can acquire information and use the commands of socket
If someone can help me ...
I must not create a netpoint and I not sale my applications I work at school
When a client is connetted to server I create an array with oClient:nSocket and oClient:ClientIP()
I 'am trying to understand How I can acquire information and use the commands of socket
If someone can help me ...
I must not create a netpoint and I not sale my applications I work at school
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- MarcoBoschi
- Posts: 925
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
Re: send a data to a client
Silvio,
did you try sockcli.prg and sockserv.prg in two different computers?
In example in sockserv.prg
works fine!
did you try sockcli.prg and sockserv.prg in two different computers?
In example in sockserv.prg
Code: Select all
DEFINE BUTTON OF oBar ACTION oClient:SendData( "Hello from server!" ) TOOLTIP "Talk to client"
Marco Boschi
info@marcoboschi.it
info@marcoboschi.it
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: send a data to a client
yes
SERVER---> Sockserv-prg
one PC----------------------------> Sockcli.prg
Second Pc ----------------------->Sockcli.prg
third Pc -------------------------- >Sockcli.prg
Now I stay on server and send a message ...where I sent the message
only to third Pc...Why ? because only the the server is connected to third pc
oooooooohhhhhhhhhhhh !!!!!!!!!!!!
SERVER---> Sockserv-prg
one PC----------------------------> Sockcli.prg
Second Pc ----------------------->Sockcli.prg
third Pc -------------------------- >Sockcli.prg
Now I stay on server and send a message ...where I sent the message
only to third Pc...Why ? because only the the server is connected to third pc
oooooooohhhhhhhhhhhh !!!!!!!!!!!!
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: send a data to a client
Silvio,
You need to keep an array with all the clients that you are serving.
In FWH\source\classes\tnewssrv.prg there is an example of a News server that uses sockets and multiple clients
You need to keep an array with all the clients that you are serving.
In FWH\source\classes\tnewssrv.prg there is an example of a News server that uses sockets and multiple clients
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: send a data to a client
Thanks
I hope to build a chat with socket or understand How I can make
I wish call from server a function to snapshot client screen home I cam make ?
I hope to build a chat with socket or understand How I can make
I wish call from server a function to snapshot client screen home I cam make ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC