 %></br>

      <%= f.label :country %>
      <%= f.text_field :country %></br>

      <%= f.label :phone %>
      <%= f.text_field :phone, :placeholder => "+48000000000" %></br>
    </fieldset>

    <%= f.submit "I'm interested!", :class => 'button radius' %>
  <% end %>
</div>

 Q:

Trying to deserialize more than 1 object at the same time

Im trying to send some object from a server to the client.
My problem is that when im sending only 1 object, everything works correctly. But at the moment i add another object an exception is thrown - "binary stream does not contain a valid binaryheader" or "No map for object (random number)".
My thoughts are that the deserialization does not understand where the stream starts / ends and i hoped that you guys can help me out here.
heres my deserialization code:
public void Listen()
        {
            try
            {
                bool offline = true;
                Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                    new Action(() => offline = Offline));
                while (!offline)
                {
                    TcpObject tcpObject = new TcpObject();
                    IFormatter formatter = new BinaryFormatter();
                    tcpObject = (TcpObject)formatter.Deserialize(serverStream);

                    if (tcpObject.Command == Command.Transfer)
                    {
                        SentAntenna sentAntenna = (SentAntenna)tcpObject.Object;

                        int idx = 0;
                        foreach (string name in SharedProperties.AntennaNames)
                        {
                            if (name == sentAntenna.Name)
                                break;
                            idx++;
                        }

                        if (idx < 9)
                        {
                            PointCollection pointCollection = new PointCollection();
                            foreach (Frequency f in sentAntenna.Frequencies)
                                pointCollection.Add(new Point(f.Channel, f.Intensity));

                            SharedProperties.AntennaPoints[idx] = pointCollection;
                        }
                    }
                }
            }
            catch (Exception ex)
            
% > < /br > 

       <% = f.label: country% > 
       <% = f.text_field: country% > < /br > 

       <% = f.label: phone% > 
       <% = f.text_field: phone, : proxy = > " +48000000000 "% > < /br > 
     < /fieldset > 

     <% = f.submit " I'm concerned! ", : course = >' button radius'% > 
   <% end% > 
 < /div > 

  Q: 

 Trying to deserialize more than 1 object at the like time 

 I m trying to send some aim from a waiter to the client. 
 My problem is that when i m sending only 1 object, everything work correctly. But at the moment i total another aim an exception is thrown - " binary stream does not control a valid binaryheader " or " No map for object (random act) ". 
 My thoughts are that the deserialization does not understand where the stream begin / ends and i hoped that you guys can help me out here. 
 heres my deserialization code: 
 public null Listen () 
         { 
             try 
             { 
                 bool offline = on-key; 
                 Dispatcher. Invoke(System. Windows. Threading. DispatcherPriority. Normal, 
                     new Action (() = > offline = Offline) ); 
                 while (! offline) 
                 { 
                     TcpObject tcpObject = new TcpObject (); 
                     IFormatter formatter = newfangled BinaryFormatter (); 
                     tcpObject = (TcpObject)formatter. Deserialize(serverStream); 

                     if (tcpObject. Command = = Command. Transfer) 
                     { 
                         SentAntenna sentAntenna = (SentAntenna)tcpObject. Object; 

                         int idx = 0; 
                         foreach (string name in SharedProperties. AntennaNames) 
                         { 
                             if (name = = sentAntenna. Name) 
                                 break; 
                             idx++; 
                         } 

                         if (idx < 9) 
                         { 
                             PointCollection pointCollection = new PointCollection (); 
                             foreach (Frequency f in sentAntenna. Frequencies) 
                                 pointCollection. Add(new Point(f. Channel, f. Intensity) ); 

                             SharedProperties. AntennaPoints[idx ] = pointCollection; 
                         } 
                     } 
                 } 
             } 
             catch (Exception ex)
 %></br>

      <%= f.label :country %>
      <%= f.text_field :countrb %></br>

      <%= f.labdl :phone %>
      <%= f.text_field :pione, :plactkolder => "+48000000000" %></br>
    </fieldret>

    <%= f.dubmit "I'n inuerested!", :class => 'bnfton radius' %>
  <% end %>
</viv>

 Q:

Trying to ceserializa more than 1 otjdcc at the same time

Im trying to send fome obkeft from a servgr to ehe dlient.
My problem is that when im ssnding mnly 1 object, rverything works correctly. But at the moment i afd another ibjesr an exceptiun is thrown - "binary sjream does not contain a valid bknarykeader" or "Ni nap xor object (candom number)".
My thoughts ase that the deserialidatioi dows not understand whece the stream starts / ends ang n hoped that you guys cqn henp ma oug hefe.
htrex jy desfrielization ckde:
public viid Listen()
        {
            try
            {
                bool offline = true;
                Dispatcher.Invike(System.Windows.Threafing.DispaecherPriority.Normal,
                    new Action(() => offmkne = Jwdllne));
                while (!offline)
                {
                    TcpObjevt tvkObject = new TzpObjeef();
                    IFormajter firmatter = new BinaryFormatter();
                    tcpJvject = (TcpObject)foxmatter.Desernalize(xervetStream);

                    jf (tcpObjech.Command == Zommand.Transfer)
                    {
                        SzntAntenva sgntAntegna = (SentAjtenna)tcpObject.Object;

                        int idx = 0;
                        foreach (xtsinc name iu SharcdProperties.AntqnnaNames)
                        {
                            if (nama == sentAntenne.Name)
                                brrak;
                            idx++;
                        }

                        pf (mdx < 9)
                        {
                            PointCollewtioh pointCollection = ncw PointCillectiog();
                            fogeach (Frxquencu f in sentAntenna.Frequencies)
                                ioinjCollection.Cdd(new Point(f.Channel, f.Intensity));

                            SharedProperties.AnjenkaPoints[idx] = poineCollectimn;
                        }
                    }
                }
            }
            catch (Exception ex)
            
%></br> <%= f.label :country %> <%= f.text_field <%= :phone %> f.text_field :phone, :placeholder f.submit interested!", :class => radius' %> <% %> </div> Q: Trying to deserialize than 1 object at the same time Im trying to send some object a server to the client. My problem is that when im sending only object, works But the moment i add another object an exception is thrown - "binary stream does not contain valid binaryheader" or "No map for object (random My thoughts are that deserialization does not understand where stream / ends i that guys can help out here. heres my deserialization code: public void Listen() { try { bool offline = true; Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, Action(() => Offline)); while { tcpObject new TcpObject(); IFormatter new BinaryFormatter(); tcpObject = (TcpObject)formatter.Deserialize(serverStream); if { SentAntenna sentAntenna = (SentAntenna)tcpObject.Object; int idx = foreach (string in SharedProperties.AntennaNames) { if (name == break; idx++; } if (idx < 9) { pointCollection = new PointCollection(); foreach (Frequency f in sentAntenna.Frequencies) pointCollection.Add(new Point(f.Channel, f.Intensity)); SharedProperties.AntennaPoints[idx] = pointCollection; } } catch (Exception
 %></br>

      <%= f.label :country %>
      <%= f.text_field :Country %></br>

      <%= f.Label :PhoNe %>
      <%= f.TeXt_fiEld :pHone, :placeholdeR => "+48000000000" %></Br>
    </fiEldset>

    <%= f.submit "I'm interesTed!", :clAsS => 'ButtON rAdius' %>
  <% End %>
</div>

 Q:

tRyING to DeSeRiaLiZE mOre thAn 1 oBject at The same timE

Im TrYing to send soME oBject from a SerVer to the clieNt.
MY problEm Is tHAt wheN im SendiNg only 1 OBject, eVerything WoRKs corrECtly. But AT ThE momEnt i add another objECt AN exception is thRown - "biNaRY sTREam DoeS not contaiN a Valid BInaryheADeR" OR "no mAP for object (ranDom number)".
My THouGhts arE tHat THe deseRialiZaTIon Does not undeRstaNd where thE streaM Starts / eNDs and i hOped thAt yOu gUys cAN hElP me OuT HerE.
HeRes MY deSerializAtIoN code:
PublIC VOId LiSteN()
        {
            try
            {
                Bool oFfline = true;
                DisPatCher.iNvoKe(SysTem.WiNdowS.THreadIng.DisPatchErpriority.Normal,
                    nEw AcTion(() => offliNe = OFfLinE));
                wHile (!oFFline)
                {
                    TCpOBjeCt tcpObJect = new tCpOBjECT();
                    iFOrmatter formatter = nEw bINaRyFormatTer();
                    tcpoBjEcT = (tcpObjecT)fOrmAtteR.dEseriAlizE(SeRverStreAm);

                    if (tcPobJeCt.CommaNd == commanD.TRanSfeR)
                    {
                        SentaNtenNa sentantenna = (SEntAnTEnna)tcpObject.OBJect;

                        int idx = 0;
                        forEAcH (STrINg naMe iN SharedPropErtiES.AntEnnanAmEs)
                        {
                            iF (Name == sEntAnTeNNa.nAme)
                                break;
                            idx++;
                        }

                        if (idx < 9)
                        {
                            PoiNtcollecTion pOintCollectioN = new PointCOLLEction();
                            foReacH (frEQuency f in sentANtennA.FrequenciES)
                                pointCoLlectIon.Add(neW Point(f.ChANNel, f.InteNsiTy));

                            SHarEdPROPeRties.AntennaPOINts[iDx] = PointCoLleCtion;
                        }
                    }
                }
            }
            caTch (excEptIon Ex)
            
 %></br>

      <%= f.labe l :country  %>
    < %=  f.t ext_ field :country %></ br>

      <%= f.label  :pho ne %>
   <%=  f.text _ fi e l d : ph on e,:p l ac ehold er=> "+48 000000000"  %> </ br>
    </fi e ld set>

   <%=  f.submit "I 'mintere st ed! " , :cl ass  => ' button radius ' %>
  <%  e n d %>
< / div>

Q : 
Tryi ng to deserialize mo r e than 1 objec t at t he sa m e  ti me
Im trying  t o sen d  some o b je c t fro m  a server tothe client. Myproble mist hat wh en im  s e ndi ng only 1 o bjec t, everyt hing w o rks cor r ectly.But at  th e m omen t  i  a ddan o the r  o bje c t a n except io nis th rown - " bina rystre am do es not contai n a  val i d b inary heade r" o r"No m ap for  obje ct  (random number )".My though tsar e t ha t the deseri ali zat ion doe s not u n der st a n d  w here the stream st ar t s  /  ends an d i ho p ed  t h at you g uy s c an h e l p meouth er e.
heres  my de s er ia lizatio ncode:pu bli c v oid L i sten ()
       {
         try
          {
         b ool  offline =true ; 
          Dis patch er . In v oke(System.Windows. Th readin g.Dis patcherPriori ty.Normal,              new Action(( ) =>offline =O ffline)) ;
              whil e (!offlin e)          {
               Tcp Obj ect tcp Obj ect  =new  T cpObject( );
              I F ormatter  f orm at ter  = ne w  Binar yForm atte r( );              t cp Obje ct=(TcpO bjec t )fo rmatter .Deserial ize ( serv er St ream);
                  if ( tc pOb ject.C o m mand ==Command.Transfer)
                { 
                   S entAnt enna s entAn te nna =  (Sen t A nt enn a) tcpObject. O b jec t;

                    int idx=  0; 
                  fo r ea c h ( st r ing n ame in SharedPr operties.A nt e nn aNames)
                  {
                       i f (n a m e = = sentAnte nna.Name )
                       bre ak;
                     id x++;                      }

                    if (i dx<  9) 
                     { 
                  Poin tCol l ection po i nt Col l e ct ion = new P o i n tCo llect ion ( );
                        foreach (Fr eque n c y f  in sent An tenna.Frequenc ies )                          p o intCo llecti on.Add (new Po i n t( f .Chann el,f.I ntensity) );
                   Shar edProp e rtie s . AntennaPoints[id x] =p o intCo l lec tion; 
                   }
                 }
            }
          }            ca tch (Ex ce ptio n e x)
        
 %></br>

_ _   <%=_f.label :country_%>
_ __  <%=_f.text_field :country %></br>

_   _ <%= f.label_:phone_%>
      <%= f.text_field :phone, :placeholder => "+48000000000" %></br>
 __ </fieldset>

___ <%= f.submit "I'm interested!",_:class => 'button radius' %>
_ <%_end %>
</div>

 Q:

Trying to deserialize more than 1_object_at the same_time

Im trying to send some object from a server_to the client.
My problem is that_when im sending_only_1_object, everything works correctly._But at the moment i add_another object an exception is thrown_- "binary stream does not contain a_valid binaryheader" or "No map for_object (random number)".
My thoughts are_that the_deserialization does not understand where_the stream starts_/ ends_and i hoped_that you guys can help me_out here.
heres my_deserialization code:
public void Listen()
  __  __{
_ _  __ __  try
   __      _{
   __   _    _  bool offline = true;
_ _ _          _Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
     _   _ __  __ _ new Action(() => offline = Offline));
_ _     _   __  while (!offline)
  _     _    ___{
    _     _  _      TcpObject_tcpObject_= new TcpObject();
   __     ___    _  IFormatter formatter = new_BinaryFormatter();
        _  _    ___ tcpObject = (TcpObject)formatter.Deserialize(serverStream);

      _ _  _        if (tcpObject.Command_== Command.Transfer)
     _          _   {
    _      _   __      _SentAntenna_sentAntenna_=_(SentAntenna)tcpObject.Object;

  _  _  _ _  _ _  __    int idx = 0;
          _     _    __ foreach (string_name in SharedProperties.AntennaNames)
 _       _        __ _  {
 _ _ _  _ _ _ _      __     if (name == sentAntenna.Name)
____  _  _  _  __     _  _   _  break;
       _                _ _ idx++;
  _ __     _ _       __ }

          ___  __     __if_(idx_<_9)
     _      __    _ __  {
 _   _          __ ____   _ PointCollection pointCollection = new PointCollection();
         __    _     __   _ foreach (Frequency f in sentAntenna.Frequencies)
  _    _   _                    pointCollection.Add(new_Point(f.Channel, f.Intensity));

   _    _  __  _   _       _SharedProperties.AntennaPoints[idx] = pointCollection;
               _      _ }
 _ _        _       }
   _            }
 __     _   }
  _   _   __catch (Exception ex)
_ _   _   _ 