Barracuda Application Server C/C++ Reference
NetIo Struct Reference

Detailed Description

The NetIo is similar to a network file system and makes it possible for the server to access resources on another Barracuda server.

The NetIo is a web file manager client specifically designed to operate a remote HttpResMgr. In other words, the remote HttpResMgr's file system appears as a local file system to code using an instance of the NetIo class.

The NetIo is typically used during development of LSP code in an embedded device without a file system. The device can access resources on for example a remote Windows computer as if the resources are locally on the device.

It is recommended to increase the size of the Web server's default HTTP response buffer if the NetIo is configured as the I/O for a HttpResRdr, HttpResMgr, or a WebDAV instance. A size of 8Kbytes decreases the number of HTTP connections initiated when reading from the NetIo by a factor of 6. See HttpServerConfig::setResponseData for more information.

The NetIo code, which can be found in xrc/misc/NetIo.c, is delivered as example code. You must therefore include this code in your build if you intend to use the NetIo.

#include <NetIo.h>

Inheritance diagram for NetIo:

Public Member Functions

 NetIo (struct SoDisp *disp=0)
 The NetIo constructor. More...
 ~NetIo ()
 The NetIo destructor.
int setRootDir (const char *url)
 Initialize/set the URL to the far side Barracuda server. More...
int setUser (const char *user, const char *password)
 Set HTTP basic authentication username and password.
int setProxy (const char *proxy, U16 portNo, BaBool useSocksProxy)
 Set proxy. More...
int setProxyUser (const char *user, const char *password)
 Set proxy username.
int setIntfName (const char *intfName)
 When connection, bind to intfName.
void setIPv6 (bool enable)
 Use IPv6, default is IPv4.

Additional Inherited Members

- Public Attributes inherited from IoIntf
IoIntf_Property propertyFp
 Set or get property.
IoIntf_CloseDir closeDirFp
 Close directory.
IoIntf_MkDir mkDirFp
 Make directory. More...
IoIntf_Rename renameFp
 Rename resource. More...
IoIntf_OpenDir openDirFp
 Open directory.
IoIntf_OpenRes openResFp
 Open resource.
IoIntf_OpenResGzip openResGzipFp
 Open file as a compressed gzip file. More...
IoIntf_Remove removeFp
 Remove file. More...
IoIntf_RmDir rmDirFp
 Remove directory. More...
IoIntf_Stat statFp
 Get resource information.

Constructor & Destructor Documentation

◆ NetIo()

NetIo::NetIo ( struct SoDisp disp = 0)

The NetIo constructor.

A NetIo instance cannot be used before it is initialized by calling NetIo::setRootDir.

dispis an optional parameter that makes the integrated NetIo HTTP client release the dispatcher mutex when reading from or writing to the socket. The 'disp' parameter is typically set if the NetIo class is used by a Barracuda Web Server object such as a HttpResRdr instance.

Member Function Documentation

◆ setProxy()

int NetIo::setProxy ( const char *  proxy,
U16  portNo,
BaBool  useSocksProxy 

Set proxy.

proxyis the proxy IP address or hostname.
portNois the proxy listen port number.
useSocksProxyif false, use HTTPS proxy, otherwise use SOCKS5.

◆ setRootDir()

int NetIo::setRootDir ( const char *  url)

Initialize/set the URL to the far side Barracuda server.

The URL must be to either the root of a HttpResRdr or to a sub-directory within a HttpResRdr instance. As an example, a far side Barracuda server, with a HttpResRdr instance installed in the Virtual File System at URI /drive/ can be initialized as follows:

Base url: http://domainname/drive/
Sub-directory: http://domainname/drive/c/lsp/

In the second example above, the far side HttpResMgr is mapped to the root of the Windows computer. The path /c/lsp/ is to a directory where the files to a LSP application can be found.

The NetIo instance can also access a remote HttpResMgr protected by an authenticator as long as the far side authenticator accepts Basic authentication. In other words, the far side authenticator must be BasicAuthenticator or Authenticator.

urlthe URL to the far side HttpResMgr. Example: