Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Mabry Socket/X control from vfp
Message
De
13/06/2001 10:05:49
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
Using Mabry Socket/X control from vfp
Divers
Thread ID:
00518847
Message ID:
00518847
Vues:
74
I need to send and receive 00 bytes from tcp port.
I have found that ms winsock control corrupts tcp packets containing 00
bytes.

So I desided to use Mabry Socket/X control.

I made a simple test program. This program sends TCP packets to port 7
and receives data from this port.

I dropped Socket/X control to vfp 5 form and added the following code
to form init :

ACTIVATE SCREEN
CLEAR
ON SHUTDOWN QUIT
THIS.olecontrol1.CREATE()
DO WHILE THIS.olecontrol1.state!=3
IF INKEY()=27
RETURN .F.
ENDIF
? THIS.olecontrol1.lasterrorstring, THIS.olecontrol1.state
ENDDO

THIS.olecontrol1.CONNECT( 'www.eetasoft.ee', 7 )

DO WHILE THIS.olecontrol1.state!=4
IF INKEY()=27
RETURN .F.
ENDIF
? THIS.olecontrol1.lasterrorstring, THIS.olecontrol1.state
ENDDO

cBuffer = REPLICATE( CHR(0), 100 )

DO WHILE INKEY()!=27
THIS.olecontrol1.sendto('www.eetasoft.ee', 7, m.cBuffer )
THIS.olecontrol1.receivefrom('www.eetasoft.ee', 7 )
? THIS.olecontrol1.lasterrorstring, THIS.olecontrol1.state
IF LEN(THIS.olecontrol1.receivebuffer)!=100 or ;
THIS.olecontrol1.receivebuffer!=m.cBuffer
?? 'Error'
ELSE
?? 'OK'
ENDIF
ENDDO

RETURN .F.


However, this code does not cause any internet access at all.
.State after .create() remains 3

Is it possible to use Mabry Socket/X with VFP ?
Andrus
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform