-- | Network
module CsoundExpr.Opcodes.OSCNetwork.Network
    (sockrecv,
     socksend)
where



import CsoundExpr.Base.Types
import CsoundExpr.Base.MultiOut
import CsoundExpr.Base.SideEffect
import CsoundExpr.Base.UserDefined



-- | * opcode : sockrecv
--  
--  
-- * syntax : 
--  
--  >   asig sockrecv iport, ilength
--  >   asigl, asigr sockrecvs iport, ilength
--  >   asig strecv Sipaddr, iport
--  
--  
-- * 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.
--  
--  
-- * url : <http://www.csounds.com/manual/html/sockrecv.html>
 
sockrecv :: Irate -> Irate -> Arate
sockrecv i0port i1length = opcode "sockrecv" args
  where args = [to i0port, to i1length]


-- | * opcode : socksend
--  
--  
-- * syntax : 
--  
--  >   socksend asig, Sipaddr, iport, ilength
--  >   socksends asigl, asigr, Sipaddr, iport, ilength
--  >   stsend asig, Sipaddr, iport
--  
--  
-- * description : 
--  
--  Transmits data directly using the UDP (socksend and socksends)
-- or TCP (stsend) protocol onto a network. The data is not subject
-- to any encoding or special routing. The socksends opcode send a
-- stereo signal interleaved.
--  
--  
-- * url : <http://www.csounds.com/manual/html/socksend.html>
 
socksend :: Arate -> String -> Irate -> Irate -> SignalOut
socksend a0sig s1ipaddr i2port i3length = outOpcode "socksend" args
  where args = [to a0sig, to s1ipaddr, to i2port, to i3length]