My simple communication between C++ client and C# server got stuck after a message was serialized to socket (SerializeToFileDescritor).
C++ client:
Person person;
person.set_id(54321);
person.set_name("bla");
person.mutable_address()->set_line1("sdfa");
person.mutable_address()->set_line2("asdfsdfa");
cout << person.id() << endl << person.name() << endl;
cout << person.address().line2() << endl;
person.SerializeToFileDescriptor(s);
ZeroCopyInputStream* raw_input = new FileInputStream(s);
CodedInputStream* coded_input = new CodedInputStream(raw_input);
Person person2;
person2.ParseFromFileDescriptor(s);
cout << person2.id() << endl << person2.name() << endl;
cout << person2.address().line2() << endl;
C# server
var sockServer = new TcpListener(2048);
sockServer.Start();
var person = new Person { Id = 123456, Name = "Fred", Address = new Address { Line1 = "Flat 1", Line2 = "The Meadows ar garą " } };
var socket = sockServer.AcceptSocket();
Stream str = new NetworkStream(socket);
var response = Serializer.Deserialize<Person>(str);
Console.WriteLine(response.Id);
Serializer.Serialize(str, person);
It seems to me ridiculously stupid it doesn't work.
If I remove any one of these: person.SerializeToFileDescriptor(s) or person2.ParseFromFileDescriptor(s), the other will work.
What should I do to make them work both?