title: c# decode byte[] sent from python socket
body: <p>In python, I convert a <code>dictionary</code> to a <code>json</code> <code>string</code>, use standard python <code>encoding</code>, then use <code>base64</code> to further <code>encode</code> for sending over a <code>socket</code> like this.</p>
  
  <p><code>item.data</code> is a <code>list</code> of <code>dicts</code>. <code>myconverter</code> is there to handle <code>datetime</code>.</p>
  
  <pre><code>UDP_IP = "127.0.0.1"
  UDP_PORT = 5005
  
  print("UDP target IP:", UDP_IP)
  print("UDP target port:", UDP_PORT)
  
  sock = socket.socket(socket.AF_INET, # Internet
                       socket.SOCK_DGRAM) # UDP
  
  def myconverter(o):
      if isinstance(o, datetime.datetime):
          return o.__str__()
  
  
  async def main_loop() 
  
  ....
  
      async for item in streamer.listen():
          for index, quoteDict in enumerate(item.data):
              quote = json.dumps(quoteDict, default = myconverter)
  
              sock.sendto(base64.b64encode(quote.encode('ascii')),  (UDP_IP, UDP_PORT))
  </code></pre>
  
  <p>When I use <code>python</code> to get the data sent over a <code>socket</code> like this, everything works fine:</p>
  
  <pre><code>import socket
  import json
  import base64
  
  
  UDP_IP = "127.0.0.1"
  UDP_PORT = 5005
  
  sock = socket.socket(socket.AF_INET, # Internet
                       socket.SOCK_DGRAM) # UDP
  sock.bind((UDP_IP, UDP_PORT))
  
  while True:
      data, addr = sock.recvfrom(16384) # buffer size is 16384 bytes
      quote_dict = base64.b64decode(data)
      print(quote_dict)
  </code></pre>
  
  <p><strong>What is the equivalent section of <code>C#</code> code that <code>decodes</code> the <code>python</code> <code>enconded</code> <code>datagram</code> above?</strong></p>