Home Forums Support "Timeout occurred after 1000ms waiting for response packet of type 'Data Table'" Reply To: "Timeout occurred after 1000ms waiting for response packet of type 'Data Table'"

#942
Anonymous
Inactive

Hi, thanks for your reply. I think the WriteXml was throwing an exception which I didn’t see.

I solved it like this:

            NetworkComms.AppendGlobalIncomingPacketHandler<string>("RequestString", (packetHeader, connection, input) =>
            {
                //For this short example we just reply with a new CustomObject
                DataTable t = sql.RetrieveAllTables();
                t.TableName = "Tables";
                StringWriter writer = new StringWriter();

                //notice that we're ignoring the schema so we get clean XML back
                //you can change the write mode as needed to get your result
                t.WriteXml(writer, XmlWriteMode.IgnoreSchema, false);

                string myCustomObject = writer.ToString();

                //listBoxLog.Items.Add(myCustomObject);

                
                
                //When this is received by the client it will complete the synchronous request
                connection.SendObject("StringReply", myCustomObject);
            });

And on the other side I just read the XML data.

Another question which I am struggeling with right now is how do I send a multidimensional array (string[,])?

Do I need to use that wrapper which you linked to?

Best regards,
Tomas