FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Socket
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Socket
Posted: Mon May 27, 2024 12:03 PM

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 March-April 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
Posts: 231
Joined: Fri Jul 20, 2012 01:49 AM
Re: Socket
Posted: Tue May 28, 2024 02:07 AM
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/master/tests/ipsvr.prg

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


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

Lailton Fernando Mariano

Continue the discussion