FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TSocket() question
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
TSocket() question
Posted: Thu Jan 24, 2013 03:42 AM
I use TSocket() as a server to :Listen() from a Client (another party).

The question : How can I know the client connect to server (if I am server)?

I try as below code but :bConnect is not response when client connect.
Code (fw): Select all Collapse
  oSocket:bAccept = { | oSocket | ;
                       oClient := TSocket():Accept( oSocket:nSocket ),;
                       oClient:Cargo := ST_COMMAND,;
                       oClient:bRead := { | oSocket | OnRead( oSocket ) },;
                       oClient:bClose := { | oSocket | OnClose( oSocket ) }, ;
                       oClient:bConnect := { | oSocket | OnConnect( oSocket ) } }
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: TSocket() question
Posted: Thu Jan 24, 2013 02:36 PM

Do you write only server side software?

Client software are written by other people?

If you write client software too you can send immediately a
oSocket:SendData( cIp) and server knows that there is a new connection
bye

Marco Boschi
info@marcoboschi.it
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: TSocket() question
Posted: Thu Jan 24, 2013 09:27 PM
Dear Marco,

You are right, I write a server side and other party write client side. The problem is the first communication must be server side.

oClient:SendData() will be occur an error, if no client is connecting to server.

How can I know or check the connection?
MarcoBoschi wrote:Do you write only server side software?

Client software are written by other people?

If you write client software too you can send immediately a
oSocket:SendData( cIp) and server knows that there is a new connection
bye
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)

Continue the discussion