Author Topic: EndOfStreamException: Failed to read past end of stream.  (Read 6069 times)

AnKOu

  • Guest
EndOfStreamException: Failed to read past end of stream.
« on: September 30, 2013, 07:37:21 AM »
Hello,

I have a problem using RFC methods. A EndOfStreamException is launched "between" two RFCs :

  1. [RFC] void GetChannelID(uint p_idTable, int p_idPlayer)
  2.     {
  3.         if (TNManager.isHosting)
  4.         {
  5.             int l_id;
  6.             object l_param = m_correspondanceTableChannel[p_idTable];
  7.             Nullable<ChannelDatas> l_datas = GetInfosChannelParID(l_param == null ? -1 : (int)l_param);
  8.             if (l_datas == null)
  9.             {
  10.                 l_id = GetIDLibre();
  11.                 m_correspondanceTableChannel.Add(p_idTable, l_id);
  12.             }
  13.             else if (l_datas.Value.cd_nombreJoueurs == l_datas.Value.cd_nombreJoueursMax) l_id = -2;
  14.             else l_id = l_datas.Value.cd_id;
  15.             tno.Send("SetChannelID", TNManager.GetPlayer(p_idPlayer), l_id);
  16.             Debug.Log("i'm displayed in console");
  17.         }
  18.     }

   
  1.  [RFC] void SetChannelID(int p_ID)
  2.     {
  3.         Debug.Log("i'm NOT displayed in console");
  4.         m_channelID = p_ID;
  5.     }

More details, there is absolutely no other SetChannelID method and it is the host which execute each of thoses calls ( int p_idPlayer is id of host).

Thanks in advance.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: EndOfStreamException: Failed to read past end of stream.
« Reply #1 on: September 30, 2013, 10:44:46 AM »
So if it's the host that executes both of these calls... how come you're doing an RFC inside another RFC? Why don't you perform the operation all inside one RFC? Off the top of my head I can't tell you if there will be an issue when you attempt to call an RFC from inside another.