TSocket() question

TSocket() question

Postby dutch » Thu Jan 24, 2013 3: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: Select all  Expand view
 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 19.01 / 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)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: TSocket() question

Postby MarcoBoschi » Thu Jan 24, 2013 2: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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: TSocket() question

Postby dutch » Thu Jan 24, 2013 9: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 19.01 / 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)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 107 guests