Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 具有二进制序列化的网络对象链接一致性_C#_Networking_Serialization - Fatal编程技术网

C# 具有二进制序列化的网络对象链接一致性

C# 具有二进制序列化的网络对象链接一致性,c#,networking,serialization,C#,Networking,Serialization,我要求更多的解释,而不是关于c#objects的任何东西 [Serializable] class ExampleSub { public Example parent; public ExampleSub(Example parent) { this.parent= parent; } } [Serializable] class Example { List<ExampleSub> subs; public Exam

我要求更多的解释,而不是关于c#objects的任何东西

[Serializable]
class ExampleSub
{
    public Example parent;
    public ExampleSub(Example parent)
    {
        this.parent= parent;
    }
}
[Serializable]
class Example
{
    List<ExampleSub> subs;
    public Example()
    {
        for (int i = 0; i < 10; i++)
            subs.Add(new ExampleSub(this));
    }
}
[可序列化]
类示例Sub
{
公众榜样父母;
公共示例子对象(示例父对象)
{
这个。父=父;
}
}
[可序列化]
课例
{
列出潜艇;
公共示例()
{
对于(int i=0;i<10;i++)
添加(新示例Sub(本));
}
}
如果我对示例类进行二进制序列化,它将包含列表中的ExampleSubs。然后通过TCP连接发送,在另一端,它被反序列化回一个示例对象。ExampleSub的父对象是否会指向新的示例对象(应该如此)

我的问题主要围绕serialiser如何正确地将对象映射到一起,但也涉及如何识别c#对象,因为我能猜到的最接近的一点是它们的行为就像智能指针