Network Programming

The Wolfram Language includes built-in network programming, allowing uniform convenient access to both TCP and ZMQ socket functionality on all platforms, as well as a variety of functions for network connectivity and name resolution.

(RefLink[IPAddress, paclet:ref/IPAddress]) — symbolic representation of an IPv4 or IPv6 IP address

(RefLink[URL, paclet:ref/URL]) — symbolic representation of a URL, potentially including a port number (default: 80)

(RefLink[SocketConnect, paclet:ref/SocketConnect]) — start a connection to a socket

(RefLink[SocketListen, paclet:ref/SocketListen]) — set up handlers to be run whenever data arrives on a socket

(RefLink[Close, paclet:ref/Close]) — close the connection to a socket

Symbolic Representations

(RefLink[SocketObject, paclet:ref/SocketObject]) — symbolic representation of a connected socket

(RefLink[Sockets, paclet:ref/Sockets]) — get a list of remote, local, etc. sockets

Reading from Sockets

(RefLink[ReadString, paclet:ref/ReadString]) — read as a string all data until a socket is closed

(RefLink[ReadByteArray, paclet:ref/ReadByteArray]) — read as a byte array all data until a socket is closed

(RefLink[BinaryRead, paclet:ref/BinaryRead]), (RefLink[BinaryReadList, paclet:ref/BinaryReadList]) — read binary data from a socket

(RefLink[Read, paclet:ref/Read]), (RefLink[ReadList, paclet:ref/ReadList]) — read data in specified formats from a socket

(RefLink[SocketReadMessage, paclet:ref/SocketReadMessage]) — read as a byte array a single message from a socket

Writing to Sockets

(RefLink[WriteString, paclet:ref/WriteString]) — write a string to a socket

(RefLink[BinaryWrite, paclet:ref/BinaryWrite]) — write binary data to a socket

(RefLink[Write, paclet:ref/Write]) — write data in a specified format to a socket

Format Conversion

Server-Side Socket Setup

(RefLink[SocketOpen, paclet:ref/SocketOpen]) — open a socket to accept connections

Utilities

(RefLink[HostLookup, paclet:ref/HostLookup]) — look up an IP address or host name (DNS and reverse DNS)

(RefLink[PingTime, paclet:ref/PingTime]) — measure the ping time for a network host

(RefLink[TimeConstrained, paclet:ref/TimeConstrained]) — allow only a specified time for network connection

(OrangeLink[Internet Data, paclet:guide/InternetAndWebRelatedData])

Low-Level Network Operations

(RefLink[NetworkPacketCapture, paclet:ref/NetworkPacketCapture]) — capture information on all network packets

(RefLink[NetworkPacketTrace, paclet:ref/NetworkPacketTrace]) — record packets during the evaluation of an expression

(RefLink[$NetworkConnected, paclet:ref/$NetworkConnected]) — whether the network interface on your computer is active

(OrangeLink[Pub-Sub Channel Communication », paclet:guide/Channel-BasedCommunication])