That's a problem, because LB's ulong is 4 bytes, whereas a double is 8 bytes.
This is some of the messiest C code I've ever seen, and I don't know why literally everything is defined as double. I suspect this was written by someone that didn't know proper datatype management, and made everything doubles because "there, it fits".
The underlying access code doesn't use doubles, so I don't know why the metaobject they use for this uses doubles for literally everything.
a = NetSend(hSock, "myDataKDFSLKE") print "NetSend - ";a
a = NetClose(hSock) print "NetClose - ";a call NetTerm
Sub NetInit open "mesock32" for DLL as #me End Sub
Sub NetTerm close #me End Sub
Function NetSetUDP() NetSetUDP = NetSetOption(1) End Function
Function NetSetTCP() NetSetTCP = NetSetOption(0) End Function
Function NetSetOption(opt) Calldll #me, "TCP_SetOption",_ opt as long,_ NetSetOption as long End Function
''''Function TCPOpen()'''''''''' Function NetOpen(address$,Port) Timeout=1000 calldll #me, "Open", address$ As ptr,_ Port As Long,_ Timeout As Long, re As Long NetOpen=re End Function
''''Function TCPReceive$()'''''''''' Function NetReceive$(handle) buffer=4096 all=0 calldll #me, "ReceiveA" ,handle As Long,_ buffer As Long,_ all As Long, re As long if re<>0 then NetReceive$ = winstring(re) End Function
''''Function TCPPrint()'''''''''' Function NetSend(handle,text$) calldll #me, "SendA", handle As Long,_ text$ As ptr,re As Long NetSend=re End Function
''''Function TCPClose()'''''''''' Function NetClose(handle) calldll #me, "CloseA",handle As Long,_ NetClose As Long End Function
Hi Chris, I too tried your code with the Windows app, and got similar results to Rod. The Python script recieves the message from LB, but LB does not recieve a reply, as far as I can tell. It just sits there and waits. The python script prints the following message on the console "got a message from 127.0.0.1 : 52676 ==> myDataKDFSLKE" .
I do not know where that port number came from, obviously it is not in the LB program.
The Windows UDP send/receive app gets nothing. I can set up two ports using my local IP address and send and receive data with the app but I am not sure what that proves. I will try the python module and report back.
edit, failed at the first or second hurdle. Python 3.7.6 installed but I get an error