Parasol Framework
  • Gallery
  • API
  • Wiki
  • GitHub
    •  Overview
    • AddressToStr()
    • HostToLong()
    • HostToShort()
    • LongToHost()
    • SetSSL()
    • ShortToHost()
    • StrToAddress()
    • Audio
    • Core
    • Display
    • Fluid
    • Font
    • Network
    • Vector
      • Audio
      • Sound
      • File
      • MetaClass
      • Module
      • StorageDevice
      • Task
      • Thread
      • Time
      • Compression
      • Config
      • Script
      • XML
      • Controller
      • BlurFX
      • ColourFX
      • CompositeFX
      • ConvolveFX
      • DisplacementFX
      • FilterEffect
      • FloodFX
      • ImageFX
      • LightingFX
      • MergeFX
      • MorphologyFX
      • OffsetFX
      • RemapFX
      • SourceFX
      • TurbulenceFX
      • WaveFunctionFX
      • Scintilla
      • ScintillaSearch
      • Bitmap
      • Clipboard
      • Display
      • Document
      • Font
      • Picture
      • Pointer
      • Surface
      • SVG
      • ClientSocket
      • HTTP
      • NetSocket
      • Proxy
      • Vector
      • VectorClip
      • VectorColour
      • VectorEllipse
      • VectorFilter
      • VectorGradient
      • VectorGroup
      • VectorImage
      • VectorPath
      • VectorPattern
      • VectorPolygon
      • VectorRectangle
      • VectorScene
      • VectorShape
      • VectorSpiral
      • VectorText
      • VectorTransition
      • VectorViewport
      • VectorWave
      • Linux Builds
      • Windows Builds
      • Customising Your Build
      • Parasol Objects
      • Parasol In Depth
      • Fluid Reference Manual
      • Common API
      • FileSearch API
      • GUI API
      • JSON API
      • VFX API
      • Widgets
      • RIPL Reference Manual
      • Parasol Cmd Tool
      • Flute / Unit Testing
      • Embedded Document Format
      • FDL Reference Manual
      • FDL Tools
      • Action Reference Manual
      • System Error Codes

Network Module

Functions

AddressToStr | HostToLong | HostToShort | LongToHost | SetSSL | ShortToHost | StrToAddress

Structures

IPAddress | NetClient

Classes

ClientSocket | NetLookup | NetSocket | Proxy

Constants

IPADDR | NLF | NSF | NSL | NTC | SCV

AddressToStr()

Converts an IPAddress structure to an IPAddress in dotted string form.

CSTRING net::AddressToStr(struct IPAddress * IPAddress)
ParameterDescription
IPAddressA pointer to the IPAddress structure.

Converts an IPAddress structure to a string containing the IPAddress in dotted format. Please free the resulting string with FreeResource() once it is no longer required.

Result

The IP address is returned as an allocated string.

Network module documentation © Paul Manias © 2005-2025

HostToLong()

Converts a 32 bit (unsigned) long from host to network byte order.

UINT net::HostToLong(UINT Value)
ParameterDescription
ValueData in host byte order to be converted to network byte order

Converts a 32 bit (unsigned) long from host to network byte order.

Result

The long in network byte order

Network module documentation © Paul Manias © 2005-2025

HostToShort()

Converts a 16 bit (unsigned) word from host to network byte order.

UINT net::HostToShort(UINT Value)
ParameterDescription
ValueData in host byte order to be converted to network byte order

Converts a 16 bit (unsigned) word from host to network byte order.

Result

The word in network byte order

Network module documentation © Paul Manias © 2005-2025

LongToHost()

Converts a 32 bit (unsigned) long from network to host byte order.

UINT net::LongToHost(UINT Value)
ParameterDescription
ValueData in network byte order to be converted to host byte order

Converts a 32 bit (unsigned) long from network to host byte order.

Result

The Value in host byte order.

Network module documentation © Paul Manias © 2005-2025

SetSSL()

Alters SSL settings on an initialised NetSocket object.

ERR net::SetSSL(objNetSocket * NetSocket, ...)
ParameterDescription
NetSocketThe target NetSocket object.
TagsSeries of tags terminated by TAGEND.

Use the SetSSL() function to send SSL commands to a NetSocket object. The following table illustrates the commands that are currently available:

If a failure occurs when executing a command, the execution of all further commands is aborted and the error code is returned immediately.

Error Codes

OkayOperation successful.
NullArgsThe NetSocket argument was not specified.
Network module documentation © Paul Manias © 2005-2025

ShortToHost()

Converts a 16 bit (unsigned) word from network to host byte order.

UINT net::ShortToHost(UINT Value)
ParameterDescription
ValueData in network byte order to be converted to host byte order

Converts a 16 bit (unsigned) word from network to host byte order.

Result

The Value in host byte order

Network module documentation © Paul Manias © 2005-2025

StrToAddress()

Converts an IP Address in string form to an IPAddress structure.

ERR net::StrToAddress(CSTRING String, struct IPAddress * Address)
ParameterDescription
StringA null-terminated string containing the IP Address in dotted format.
AddressMust point to an IPAddress structure that will be filled in.

Converts an IPv4 or an IPv6 address in dotted string format to an IPAddress structure. The String must be of form 1.2.3.4 (IPv4).

struct IPAddress addr;
if (!StrToAddress("127.0.0.1", &addr)) {
   ...
}

Error Codes

OkayThe Address was converted successfully.
FailedThe String was not a valid IP Address.
NullArgsFunction call missing argument value(s)
Network module documentation © Paul Manias © 2005-2025

IPADDR Type

Address types for the IPAddress structure.

NameDescription
IPADDR::V4
IPADDR::V6
Network module documentation © Paul Manias © 2005-2025

NLF Type

Options for NetLookup

NameDescription
NLF::NO_CACHEContact the name service and do not use the local DNS cache.
Network module documentation © Paul Manias © 2005-2025

NSF Type

NameDescription
NSF::LOG_ALLPrint extra log messages.
NSF::MULTI_CONNECTAllow multiple connections from the same IP when in server mode.
NSF::SERVERPuts the socket into server mode. In this state the netsocket object will wait for incoming connections from clients.
NSF::SSLUse Secure Sockets Layer for all communication.
NSF::SYNCHRONOUSUse synchronous (blocking) network calls.
Network module documentation © Paul Manias © 2005-2025

NSL Type

Tags for SetSSL().

NameDescription
NSL::CONNECTInitiate an SSL connection on this socket.
Network module documentation © Paul Manias © 2005-2025

NTC Type

NetSocket states

NameDescription
NTC::CONNECTEDThere is an active connection at present.
NTC::CONNECTINGA connection is being established.
NTC::CONNECTING_SSLAn SSL connection is being established.
NTC::DISCONNECTEDThere is no connection.
Network module documentation © Paul Manias © 2005-2025

SCV Type

These error codes for certificate validation match the OpenSSL error codes (X509 definitions)

NameDescription
SCV::AKID_ISSUER_SERIAL_MISMATCH
SCV::AKID_SKID_MISMATCH
SCV::APPLICATION_VERIFICATION
SCV::CERT_CHAIN_TOO_LONG
SCV::CERT_HAS_EXPIRED
SCV::CERT_NOT_YET_VALID
SCV::CERT_REJECTED
SCV::CERT_REVOKED
SCV::CERT_SIGNATURE_FAILURE
SCV::CERT_UNTRUSTED
SCV::CRL_HAS_EXPIRED
SCV::CRL_NOT_YET_VALID
SCV::CRL_SIGNATURE_FAILURE
SCV::DEPTH_ZERO_SELF_SIGNED_CERT
SCV::ERROR_IN_CERT_NOT_AFTER_FIELD
SCV::ERROR_IN_CERT_NOT_BEFORE_FIELD
SCV::ERROR_IN_CRL_LAST_UPDATE_FIELD
SCV::ERROR_IN_CRL_NEXT_UPDATE_FIELD
SCV::INVALID_CA
SCV::INVALID_PURPOSE
SCV::KEYUSAGE_NO_CERTSIGN
SCV::OK
SCV::OUT_OF_MEM
SCV::PATH_LENGTH_EXCEEDED
SCV::SELF_SIGNED_CERT_IN_CHAIN
SCV::SUBJECT_ISSUER_MISMATCH
SCV::UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY
SCV::UNABLE_TO_DECRYPT_CERT_SIGNATURE
SCV::UNABLE_TO_DECRYPT_CRL_SIGNATURE
SCV::UNABLE_TO_GET_CRL
SCV::UNABLE_TO_GET_ISSUER_CERT
SCV::UNABLE_TO_GET_ISSUER_CERT_LOCALLY
SCV::UNABLE_TO_VERIFY_LEAF_SIGNATURE
Network module documentation © Paul Manias © 2005-2025

IPAddress Structure

FieldTypeDescription
DataINT128-bit array for supporting both V4 and V6 IP addresses.
TypeIPADDRIdentifies the address Data value as a V4 or V6 address type.
PadINTUnused padding for 64-bit alignment
Network module documentation © Paul Manias © 2005-2025

NetClient Structure

Simple data storage class utilised by NetSocket to represent a client machine/IP.

FieldTypeDescription
IPBYTEIP address in 4/8-byte format
Nextstruct NetClient *Next client in the chain
Prevstruct NetClient *Previous client in the chain
NetSocketobjNetSocket *Reference to the parent socket
SocketsobjClientSocket *Pointer to a list of sockets opened with this client.
ClientDataAPTRFree for user data storage.
TotalSocketsINTCount of all created sockets
Network module documentation © Paul Manias © 2005-2025