I'm new to DBpro, but have quite a bit of experience programming C++ and VB. I'd like to have my DB program connect to a server that I wrote using c++, but I am having a little trouble. The server is set up to send out a string (ending in a \n) about 10 times a second. I know the server is working correctly, because I can easily connect to it using a few lines of VB code and get the results I'm looking for. Here's what I've tried in DB:
sync on
rem Using Ariel Benzakein's network dll
load dll "network.dll",1
FileHandle = call dll(1,"OpenTCPPort",10001,"localhost",2000)
for count=1 to 5
sync
response$ = call dll(1,"TCPLineInput",FileHandle)
print "tcp data="+response$
wait 100
next count
delete dll 1
I start my server. Then run this code. I get this as a result:
tcp data=This is a test message
tcp data=
tcp data=
tcp data=
tcp data=
I should be seeing the test message from my server on every line. I have played with the wait time and the number of times the for/next repeats. However, all I get is data on the first line. Any suggestions?
In VB I use the event tcpClient_DataArrival. Is there anything like this in DB?
Thanks,
Zach