public override void mantainOpenChanel() { vectorInformacionStream = vectorInformacion.GetStream(); BinaryFormatter binewuprpoieqwrtckckjrkjkr = new BinaryFormatter(); while (true) { try { if (vectorInformacion.Available > 0) { NetInformation infi = binewuprpoieqwrtckckjrkjkr.Deserialize(vectorInformacionStream) as NetInformation; onInfoReseived(infi); //onSendErrooor("resivido: " + infi.enviadoId + ", " + infi.comando); } } catch (Exception e) { onSendErrooor(e.Message + ", " + e.StackTrace.ToString()); try { vectorInformacionStream = vectorInformacion.GetStream(); } catch (Exception erc) { onSendErrooor(erc.Message + ", " + erc.StackTrace.ToString()); } } } }
public override void sendData(NetInformation info) { try { BinaryFormatter binryu = new BinaryFormatter(); binryu.Serialize(vectorInformacionStream, info); //onSendErrooor("enviado " + info.enviadoId + ", " + info.comando); } catch (Exception e) { try { onSendErrooor("error con el mensaje " + info._gamesStatus + "estado, " + info.comando + " Comando, " + info.enviadoId + " ID de el enviado, " + info.contentOfEnviado + "y : " + e.Message + ", " + e.StackTrace.ToString()); vectorInformacionStream = vectorInformacion.GetStream(); } catch (Exception erc) { onSendErrooor(e.Message + ", " + e.StackTrace.ToString()); } } }
protected virtual void onInfoReseived(NetInformation obj) { if (infoReseived != null) { infoReseived(obj); } }
public override void mantainOpenChanel() { comandoStream = comandos.GetStream(); BinaryFormatter binareador = new BinaryFormatter(); while (true) { try { if (comandos.Available > 0) { NetInformation neterds = binareador.Deserialize(comandoStream) as NetInformation; onInfoReseived(neterds); //onSendErrooor("mensaje resivido"); } } catch (Exception e) { onSendErrooor(e.Message + ", " + e.StackTrace.ToString()); try { comandoStream = comandos.GetStream(); } catch (Exception erc) { onSendErrooor(erc.Message + ", " + erc.StackTrace.ToString()); } } } }
public abstract void sendData(NetInformation info);