This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34T62-N84MB-7DQGY-G7XGT-YTQ63 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CrossPlatformTypeBinder : DefaultSerializationBinder | |
{ | |
static readonly bool isNetCore = Type.GetType("System.String, System.Private.CoreLib") != null; | |
readonly ConcurrentDictionary<string, Type> mappedTypes = new ConcurrentDictionary<string, Type>(); | |
public override Type BindToType(string assemblyName, string typeName) | |
{ | |
mappedTypes.TryGetValue(typeName, out var type); | |
if (type != null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace HolePunchTest | |
{ | |
public class TcpProxy |