With Http Dll 2 you can send HTTP requests and read (or save) the results. It can also create sockets (normal sockets or listening sockets) and binary buffers, and communicate via UDP protocol.
-Supports listening sockets (server) and normal sockets (client). -Supports IPv4 and IPv6. -Supports TCP and UDP. -Data via buffers. -Zlib compression for buffers. -Hexadecimal and base64 encoding/decoding. -c++ source code included -Licensed under GPL -DLL is 252.5KiB in size. -No dependencies.
This DLL is very straightforward, and includes documentation for all its functions (except the HTTP part, which is un-documented as LB already has HTTP capabilities). This is much more straightforward and easy than winsock programming, as it's a wrapper on it.
http-dll.zip (231.71 KB) Please note that members find this download has many problem, Rod.
Http Dll 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with Http Dll 2. If not, see <http://www.gnu.org/licenses/>.
Who is the author, is it you? Will be some LB code examples for it?
It's not all mine, however I made some slight modifications and compiled the distributed dll. The reason there's no code samples was because it's fairly easy to interact with the DLL via calldll, but here's three, one for each of: bufffers, sockets, and udpsockets:
'Code to work with buffers.
open "http_dll_2_3.dll" for dll as #buffer
calldll #buffer, "buffer_create", result as double
bufferID = result 'the buffer id. important.
'Since we've created a buffer, we can now utilize it:
'For example, READ A DOUBLE from the buffer calldll #buffer, "buffer_read_float64", bufferID as double, return as double
'Then CLEAR BUFFER, before we write to it calldll #buffer, "buffer_clear", bufferID as double, return as double
'Finally, WRITE A DOUBLE to it val = 3.14 calldll #buffer, "buffer_write_float64", bufferID as double, val as double, return as double
'If we like, we can read that same value from it: calldll #buffer, "buffer_read_float64", bufferID as double, return as double
Yes the pointer is just a handle to a memory location. I am not sure why the pointer is typed as double. I would have thought long was more appropriate. I am not at home and don't have access to my API book. Ntech might contribute.