Page 1 of 1

Socket

PostPosted: Mon May 27, 2024 12:03 pm
by Silvio.Falconi
I tried SockClient.prg and sockserv.prg

but I not understood how send a txt file from a computer to another not on the same Lan


Is there a small functional example how to send and receive a text file from one computer to another and vice versa?

Re: Socket

PostPosted: Tue May 28, 2024 2:07 am
by Lailton
You should have 2 codes, one is to create a SERVER to be waiting for a connection and another one to CONNECT to the server.

Here you have the example server ( running port 10000 ):
https://github.com/harbour/core/blob/ma ... /ipsvr.prg

then the next step, here is HOW to connect to the first one:
https://github.com/harbour/core/blob/ma ... ipclnt.prg


Note:
It require muitthread, so add to your build -mt
:D