title: How to host service using UDP in WCF?
body: <p>I am trying to host a service using UDP in WCF but I can't generate a proxy from the service. I need to host the service on a LAN. Can anyone give an example for a server and client using UDP in WCF?</p>
  
  <p>Here is my app.config file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;system.serviceModel&gt;
  
      &lt;extensions&gt;
        &lt;bindingElementExtensions&gt;
          &lt;add name="udp_Transport" type="Microsoft.ServiceModel.Samples.UdpTransportElement, UdpTransport" /&gt;
        &lt;/bindingElementExtensions&gt;
      &lt;/extensions&gt;
  
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name=""&gt;
            &lt;dataContractSerializer maxItemsInObjectGraph="2147483647"/&gt;
            &lt;serviceMetadata httpGetEnabled="false"/&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;bindings&gt;
        &lt;udpBinding&gt;
          &lt;binding name="UDPBinding" openTimeout="24.20:31:23.6470000" receiveTimeout="24.20:31:23.6470000" sendTimeout="24.20:31:23.6470000" maxBufferPoolSize="10000000" maxReceivedMessageSize="10000000"&gt;
            &lt;readerQuotas maxDepth="10000000" maxStringContentLength="10000000" maxArrayLength="10000000" maxBytesPerRead="10000000" maxNameTableCharCount="10000000"/&gt;         
          &lt;/binding&gt;
        &lt;/udpBinding&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service name="UDP_Server.Service1"&gt;
          &lt;endpoint address="soap.udp://localhost:40000/Service1/" binding="udpBinding" bindingConfiguration="UDPBinding" contract="UDP_Server.IService1"&gt;
            &lt;identity&gt;
              &lt;dns value="localhost"/&gt;
            &lt;/identity&gt;
          &lt;/endpoint&gt;
  
  
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="soap.udp://localhost:40000/Service1/"/&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
        &lt;/service&gt;
      &lt;/services&gt;
    &lt;/system.serviceModel&gt;
  &lt;startup&gt;&lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/&gt;&lt;/startup&gt;&lt;/configuration&gt;
  </code></pre>