NetTcpBinding with SecurityMode.Transport not work
I have a simple WCF client/server implementation using NetTcp duplex channels. If I create the binding with SecurityMode.None then I can successfully call from the client to the server and handle the callbacks.
However, as soon as I change it to SecurityMode.Transport (NetTcpBinding binding = new NetTcpBinding(SecurityMode.Transport);) I start to get the following error when making the call to the server:
System.IO.IOException: Read failure ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host.
at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, Int32 offset, Int32 size, SocketFlags flags) [0x00000] in <filename unknown>:0
at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0
at System.IO.Stream.ReadByte () [0x00007] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/Stream.cs:168
at System.ServiceModel.Channels.TcpBinaryFrameManager.ProcessPreambleAckInitiator () [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.TcpDuplexSessionChannel.OnOpen (TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.CommunicationObject.Open (TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.ClientRuntimeChannel.OnOpen (TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.CommunicationObject.Open (TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.CommunicationObject.Open () [0x00000] in <filename unknown>:0
at System.ServiceModel.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.ServiceModel.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0
Is this something which isn't supported by Unity3d? If I run it on Windows application then it works fine, but when I run it on unity......
Your answer
![](https://koobas.hobune.stream/wayback/20220612101400im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Consume Async methods async in Unity from a WCF service 0 Answers
Unity switches scenes when Ad is closed. 0 Answers
building gradle project failure after importing google play service plugin 1 Answer
Can i have old services from 2017 version in 2020 version? 0 Answers
using FLAG_SECURE (Android) in a unity project to hide sensitive content when app is suspended 0 Answers