Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending binary data using MS WINSOCKET
Message
From
14/06/2001 17:35:08
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Sending binary data using MS WINSOCKET
Miscellaneous
Thread ID:
00519744
Message ID:
00519744
Views:
54
I try to send binary data using MS WINSOCKET control shipped with VFP 6.
I added it to form and created connection to server echo port 7
When I send 00 bytes in TCP packet they get corrupted.
I tried to use createbinary() in senddata() and vbArray + vbByte on getdata()
but it does'nt help: 00 bytes are replaced to random characters in TCP packets.

Why the following code corrups 00 chararacters ?
* If I use any other char instead of chr(0), it works OK.
cStr = replicate( chr(0), 100 )
thisform.olecontrol1.SendData(createbinary(cStr))
local lStart
lStart = seconds()
priv ctulem
ctulem = ''
do while seconds()-lStart<20 and empty(ctulem) and ;
          thisform.OLEControl1.state!=9 and inkey(0.5)!=27

  if this.olecontrol1.state=8
    messagebox( 'Connection closed' )
    return .f.
    endif

  ctulem = ''
  thisform.OLEControl1.GetData( @ctulem )
  * I tried also the follwoing code:
  * thisform.OLEControl1.GetData( @ctulem, 8192+17, 200 )
  enddo
Andrus
Reply
Map
View

Click here to load this message in the networking platform