ChannelPreSendFunction

ChannelPreSendFunction

is an option to ChannelObject and related functions that specifies a function to apply to outgoing messages before they are sent to the server.

Details

Examples

Basic Examples  (2)

Create a channel with a custom preprocessing function:

In[1]:=
Click for copyable input
Out[1]=

Start listening on the channel and send a message to it:

In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

The received message:

In[4]:=
Click for copyable input
Out[4]=

Restore the original message content:

In[5]:=
Click for copyable input
Out[5]=

Remove the listener and delete the channel:

In[6]:=
Click for copyable input
Out[6]=
In[7]:=
Click for copyable input
Out[7]=

Sending encrypted messages:

In[1]:=
Click for copyable input
Out[1]=

Set up a listener and send a message:

In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

The message is encrypted:

In[4]:=
Click for copyable input
Out[4]=

Retrieve the message:

In[5]:=
Click for copyable input
Out[5]=

Cleanup:

In[6]:=
Click for copyable input
Out[6]=
In[7]:=
Click for copyable input
Out[7]=

See Also

ChannelSend  CreateChannel  ChannelObject  ChannelListen  $Pre

Introduced in 2016
(11.0)