WCF_Config頁面常用配置
右键点击App.config文件,选中Edit WCF Configuration进行编辑,我们添加2个baseAddress,一个是基于HTTP协议的;一个是基于TCP协议的。同时添加2个bindings项,一个是basicHttpBinding;一个是netTcpBinding。同时添加2个endpoint,一个是指向basicHttpBinding,一个是指向netTcpBinding。主要配置如下:
baseAddress:
<host> <baseAddresses> <add baseAddress="http://localhost:8732/Design_Time_Addresses/StreamingTransfersServer/MediaStreaming/" /> <add baseAddress="net.tcp://localhost:9001"/> </baseAddresses> </host>
bindings:
<bindings> <basicHttpBinding> <binding name="basicHttpStreaming" maxBufferSize="40000000" maxReceivedMessageSize="40000000" messageEncoding="Mtom" transferMode="Streamed" /> </basicHttpBinding> <netTcpBinding> <binding name="netTcpStreaming" transferMode="Streamed" maxBufferSize="40000000" maxReceivedMessageSize="40000000" /> </netTcpBinding> </bindings>
多一分冷靜,少一分浮躁