sockrecvNetworksockrecvsockrecv
Receives data from other processes using the low-level UDP or TCP protocols
Description
Receives directly using the UDP (sockrecv and
sockrecvs) or TCP (strecv)
protocol onto a network. The data is not subject to any encoding or special
routing. The sockrecvs opcode receives a stereo signal
interleaved.
Syntaxasig sockrecv iport, ilengthksig sockrecv iport, ilengthasigl, asigr sockrecvs iport, ilengthString sockrecv iport, ilengthasig[,kstate] strecv Sipaddr, iportInitializationSipaddr
-- a string that is the IP address of the sender in standard
4-octet dotted form.
iport
-- the number of the port that is used for the communication.
ilength
-- the length of the individual packets in UDP transmission.
This number must be sufficiently small to fit a single MTU,
which is set to the save value of 1456. In UDP transmissions
the sender and receiver needs agree on this value
Performanceasig, asigl, asigr -- audio data to be
received.
ksig -- control data to be received.
String -- string data to be received.
kstate -- optional output to give the state
of the receipt. Gives the number of bytes transferred in the
current performance cycle or -1 if the sender has ceased writing.
Example
The example shows a mono signal being received on port 7777 using UDP.
sr= 44100
ksmps= 100
nchnls= 1
instr 1
a1 sockrecv 7777, 200
out a1
endinSee alsoNetworkCreditsAuthor: &namejohn;2006kstate optional output new in 6.14