Socket

Post Reply
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Socket

Post 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?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Lailton
Posts: 156
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil
Contact:

Re: Socket

Post 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
Regards,
Lailton Fernando Mariano
Post Reply