Note that there are some explanatory texts on larger screens.

plurals
  1. POC#, Binary Serialization over Socket Communication
    primarykey
    data
    text
    <p>I use Binary Serialization Object to Read or Write Data Stream and previously if we are going to write/read them we have to compile the <em>"instance class"</em> to be DLL file so we have same Assemblies between them, is it right?</p> <p>well now, here is my problem:</p> <p>this is my Binary Sender Code </p> <pre><code>public void SendBinarySerial(object graph) { IFormatter formatter = new BinaryFormatter(); System.Net.Sockets.NetworkStream strm = mClient.GetStream(); //get TCPclient stream formatter.Serialize(strm, graph); } </code></pre> <p>and here is my Binary Receiver code:</p> <pre><code>private void doRead() { do { if (mClient.GetStream().CanRead) { System.Net.Sockets.NetworkStream strm = mClient.GetStream(); IFormatter formatter = new BinaryFormatter(); object mydat = (object)formatter.Deserialize(strm);//deserialize data receiver } } while (true); } </code></pre> <p>And this is my <em>"instance class"</em> code that i want to send to the entire of clients. ok Let's consider the following code:</p> <pre><code>[Serializable()] public class DataSend { public List&lt;Bitmap&gt; MainData = new List&lt;Bitmap&gt;(); public List&lt;string&gt; Title = new List&lt;string&gt;(); } </code></pre> <p>As you can see , there are several <em>List</em> Variables such as Bitmap and string. the Bitmap data is for image data. if I fill it with many images it will increase the size of variable memory, maybe about 20 mb.</p> <p>After that I'm about to send them to the entire of clients. Well, here is my question:</p> <p><strong>Using this technique, if the size object is about 20 mb, will this Work well? I know that Socket Communication has a size limit for sending data</strong></p> <p>I don't want to define any protocols at all, I just want to use Socket Communication although maybe this is not best way.</p> <p>Thanks for your response.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload