| 1 | |
| 2 | <refentry id="socksend"> |
| 3 | <indexterm id="Indexsocksend"><primary>socksend</primary></indexterm> |
| 4 | <refentryinfo><title>Network</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>socksend</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>socksend</refname> |
| 11 | <refpurpose> |
| 12 | Sends data to other processes using the low-level UDP or TCP protocols |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Transmits data directly using the UDP (<emphasis>socksend</emphasis> and |
| 20 | <emphasis>socksends</emphasis>) or TCP (<emphasis>stsend</emphasis>) |
| 21 | protocol onto a network. The data is not subject to any encoding or special |
| 22 | routing. The <emphasis>socksends</emphasis> opcode send a stereo signal interleaved. |
| 23 | </para> |
| 24 | </refsect1> |
| 25 | |
| 26 | <refsect1> |
| 27 | <title>Syntax</title> |
| 28 | <synopsis><command>socksend</command> asig, Sipaddr, iport, ilength</synopsis> |
| 29 | <synopsis><command>socksend</command> ksig, Sipaddr, iport, ilength</synopsis> |
| 30 | <synopsis><command>socksends</command> asigl, asigr, Sipaddr, iport, |
| 31 | ilength</synopsis> |
| 32 | <synopsis><command>stsend</command> asig, Sipaddr, iport</synopsis> |
| 33 | </refsect1> |
| 34 | |
| 35 | <refsect1> |
| 36 | <title>Initialization</title> |
| 37 | <para> |
| 38 | <emphasis>Sipaddr</emphasis> |
| 39 | -- a string that is the IP address of the receiver in standard |
| 40 | 4-octet dotted form. |
| 41 | </para> |
| 42 | |
| 43 | <para> |
| 44 | <emphasis>iport</emphasis> |
| 45 | -- the number of the port that is used for the communication. |
| 46 | </para> |
| 47 | |
| 48 | <para> |
| 49 | <emphasis>ilength</emphasis> |
| 50 | -- the length of the individual packets in UDP transmission. |
| 51 | This number must be sufficiently small to fit a single MTU, |
| 52 | which is set to the save value of 1456. In UDP transmissions |
| 53 | the receiver needs to know this value |
| 54 | </para> |
| 55 | |
| 56 | </refsect1> |
| 57 | |
| 58 | <refsect1> |
| 59 | <title>Performance</title> |
| 60 | <para> |
| 61 | <emphasis>asig, ksig, asigl, asigr</emphasis> -- data to be transmitted. |
| 62 | </para> |
| 63 | |
| 64 | </refsect1> |
| 65 | |
| 66 | <refsect1> |
| 67 | <title>Example</title> |
| 68 | <para> |
| 69 | The example shows a simple sine wave being sent just |
| 70 | once to a computer called "172.16.0.255", on port 7777 using UDP. |
| 71 | Note that .255 is often used for broadcasting. |
| 72 | </para> |
| 73 | |
| 74 | <informalexample> |
| 75 | <programlisting> |
| 76 | <emphasis role="ohdr">sr</emphasis> <emphasis role="op">=</emphasis> 44100 |
| 77 | <emphasis role="ohdr">ksmps</emphasis> <emphasis role="op">=</emphasis> 100 |
| 78 | <emphasis role="ohdr">nchnls</emphasis> <emphasis role="op">=</emphasis> 1 |
| 79 | |
| 80 | |
| 81 | <emphasis role="oblock">instr</emphasis> 1 |
| 82 | a1 <emphasis role="opc">oscil</emphasis> 20000,441,1 |
| 83 | <emphasis role="opc">socksend</emphasis> a1, "172.16.0.255",7777, 200 |
| 84 | <emphasis role="oblock">endin</emphasis></programlisting> |
| 85 | </informalexample> |
| 86 | |
| 87 | </refsect1> |
| 88 | |
| 89 | <refsect1> |
| 90 | <title>See also</title> |
| 91 | <para><link linkend="Network"><citetitle>Network</citetitle></link></para> |
| 92 | </refsect1> |
| 93 | |
| 94 | <refsect1> |
| 95 | <title>Credits</title> |
| 96 | <para> |
| 97 | <simplelist> |
| 98 | <member>Author: &namejohn;</member> |
| 99 | <member>2006</member> |
| 100 | </simplelist> |
| 101 | </para> |
| 102 | </refsect1> |
| 103 | </refentry> |