public void Verify_Stop_Auto_Command_Is_Sent() { TestStandMapping mapping = new TestStandMapping(); Session session = new Session(mapping); DataStore dataStore = new DataStore(session); Mock <IUserInterface> ui = new Mock <IUserInterface>(); Mock <LogThread> logThread = new Mock <LogThread>(dataStore); IOThread ioThread = new IOThread(dataStore, ref session); Program p = new Program(dataStore, logThread.Object, ioThread, ui.Object); p.OnStartAutoSequencePressed(); p.OnStopAutoSequencePressed(); List <Command> commands = ioThread.Commands; byte[] command1 = commands[0].ToByteData(); byte[] command2 = commands[1].ToByteData(); Assert.AreEqual(command1.Length, 2); Assert.AreEqual(command2.Length, 2); Assert.AreEqual(command1[0], 202); Assert.AreEqual(command2[0], 202); Assert.AreEqual(command1[1], 1); Assert.AreEqual(command2[1], 0); }
public PgmListener([NotNull] IOThread ioThread, [NotNull] SocketBase socket, [NotNull] Options options) : base(ioThread, options) { this.m_socket = socket; this.m_ioObject = new IOObject(ioThread); }
public void Plug(IOThread ioThread, SessionBase session) { m_session = session; m_encoder.SetMsgSource(session); // get the first message from the session because we don't want to send identities var msg = new Msg(); msg.InitEmpty(); bool ok = session.PullMsg(ref msg); if (ok) { msg.Close(); } AddSocket(m_socket); if (!m_delayedStart) { StartConnecting(); } else { m_state = State.Delaying; AddTimer(GetNewReconnectIvl(), ReconnectTimerId); } }
/// <summary> /// This method is called when a message receive operation has been completed. /// </summary> /// <param name="socketError">a SocketError value that indicates whether Success or an error occurred</param> /// <param name="bytesTransferred">the number of bytes that were transferred</param> public void InCompleted(SocketError socketError, int bytesTransferred) { if (socketError != SocketError.Success) { m_socket.EventAcceptFailed(m_address.ToString(), socketError.ToErrorCode()); // dispose old object m_acceptedSocket.Handle.Dispose(); Accept(); } else { m_acceptedSocket.InitOptions(); var pgmSession = new PgmSession(m_acceptedSocket, m_options); IOThread ioThread = ChooseIOThread(m_options.Affinity); SessionBase session = SessionBase.Create(ioThread, false, m_socket, m_options, new Address(m_handle.LocalEndPoint)); session.IncSeqnum(); LaunchChild(session); SendAttach(session, pgmSession, false); m_socket.EventAccepted(m_address.ToString(), m_acceptedSocket.Handle); Accept(); } }
public PgmListener(IOThread ioThread, SocketBase socket, Options options) : base(ioThread, options) { m_socket = socket; m_ioObject = new IOObject(ioThread); }
public void Plug(IOThread ioThread, SessionBase session) { m_session = session; // get the first message from the session because we don't want to send identities var msg = new Msg(); msg.InitEmpty(); var pullResult = session.PullMsg(ref msg); if (pullResult == PullMsgResult.Ok) { msg.Close(); } Assumes.NotNull(m_socket); AddSocket(m_socket); if (!m_delayedStart) { StartConnecting(); } else { m_state = State.Delaying; AddTimer(GetNewReconnectIvl(), ReconnectTimerId); } }
public ReqSession(IOThread ioThread, bool connect, SocketBase socket, Options options, Address addr) : base(ioThread, connect, socket, options, addr) { m_state = State.Identity; }
public PgmListener( IOThread ioThread, SocketBase socket, Options options) : base(ioThread, options) { m_socket = socket; m_ioObject = new IOObject(ioThread); }
public void Plug(IOThread ioThread, SessionBase session) { m_session = session; m_encoder.SetMsgSource(session); // get the first message from the session because we don't want to send identities var msg = new Msg(); msg.InitEmpty(); bool ok = session.PullMsg(ref msg); if (ok) { msg.Close(); } AddSocket(m_socket); if (!m_delayedStart) { StartConnecting(); } else { m_state = State.Delaying; AddTimer(GetNewReconnectIvl(), ReconnectTimerId); } }
/// <summary> /// Create a new TcpListener on the given IOThread and socket. /// </summary> /// <param name="ioThread">the IOThread for this to live within</param> /// <param name="socket">a SocketBase to listen on</param> /// <param name="options">socket-related Options</param> public TcpListener([NotNull] IOThread ioThread, [NotNull] SocketBase socket, [NotNull] Options options) : base(ioThread, options) { this.m_ioObject = new IOObject(ioThread); this.m_address = new TcpAddress(); this.m_handle = null; this.m_socket = socket; }
/// <summary> /// Create a new TcpListener on the given IOThread and socket. /// </summary> /// <param name="ioThread">the IOThread for this to live within</param> /// <param name="socket">a SocketBase to listen on</param> /// <param name="options">socket-related Options</param> public TcpListener( IOThread ioThread, SocketBase socket, Options options) : base(ioThread, options) { m_ioObject = new IOObject(ioThread); m_address = new TcpAddress(); m_handle = null; m_socket = socket; }
public TcpListener(IOThread ioThread, SocketBase socket, Options options) : base(ioThread, options) { m_ioObject = new IOObject(ioThread); m_address = new TcpAddress(); m_handle = null; m_socket = socket; }
public void Single_Component_Is_Updated_After_Incoming_Data_Without_Logging() { byte ID = 0; // Value = 1337 = 0x539 byte valMSB = 0x05; byte valLSB = 0x39; LoadComponent expectedResult = new LoadComponent(0, "", ""); expectedResult.Set(1337); TestStandMapping mapping = new TestStandMapping(); Session session = new Session(mapping); Mock <IDataLog> dataMock = new Mock <IDataLog>(); Mock <ISerialPort> serialMock = new Mock <ISerialPort>(); byte[] buffer = { 0xAA, 0xBB, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x03, ID, valMSB, valLSB, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xBB }; int i = 0; serialMock.Setup(x => x.IsOpen).Returns(true).Callback(() => Console.WriteLine("IsOpen called")); serialMock.Setup(x => x.BytesToRead).Returns(buffer.Length - i).Callback(() => Console.WriteLine("BytesToRead called")); serialMock.Setup(x => x.Read(It.IsAny <byte[]>(), It.IsAny <int>(), It.IsAny <int>())) .Returns((byte[] b, int o, int c) => { int nbytes = Math.Min(c, buffer.Length - i); Array.Copy(buffer, i, b, 0, nbytes); i += nbytes; i = (i >= buffer.Length) ? 0 : i; Console.WriteLine("Got {0} bytes", nbytes); return(nbytes); }).Callback(() => Console.WriteLine("Read called")); bool wait = true; IOThread conn = new IOThread(dataMock.Object, ref session); dataMock.Setup(x => x.Enqueue(It.IsAny <DataPacket>())).Callback((DataPacket dp) => { session.UpdateComponents(dp.Bytes); conn.StopConnection(); wait = false; }); conn.StartConnection(serialMock.Object, null); Console.WriteLine("Thread started"); Stopwatch watch = new Stopwatch(); watch.Start(); while (wait && watch.ElapsedMilliseconds < 2000) { Thread.Sleep(100); } Assert.AreEqual(expectedResult.Newtons(), ((LoadComponent)mapping.ComponentsByID()[ID]).Newtons()); }
public PgmSender( IOThread ioThread, Options options, Address addr) : base(ioThread) { m_options = options; m_addr = addr; m_encoder = null; m_outBuffer = null; m_outBufferSize = 0; m_writeSize = 0; m_encoder = new V1Encoder(0, m_options.Endian); m_state = State.Idle; }
public PgmSender([NotNull] IOThread ioThread, [NotNull] Options options, [NotNull] Address addr) : base(ioThread) { m_options = options; m_addr = addr; m_encoder = null; m_outBuffer = null; m_outBufferSize = 0; m_writeSize = 0; m_encoder = new V1Encoder(0, m_options.Endian); m_state = State.Idle; }
public void Verify_Timed_Servo_Command() { TestStandMapping mapping = new TestStandMapping(); Session session = new Session(mapping); DataStore dataStore = new DataStore(session); Mock <IUserInterface> ui = new Mock <IUserInterface>(); Mock <LogThread> logThread = new Mock <LogThread>(dataStore); IOThread ioThread = new IOThread(dataStore, ref session); Program p = new Program(dataStore, logThread.Object, ioThread, ui.Object); ServoCommand cmd1 = new ServoCommand(6, 69.0f); ServoCommand cmd2 = new ServoCommand(6, 0.0f); byte[] actual = {}; Mock <ISerialPort> serial = new Mock <ISerialPort>(); serial.Setup(x => x.IsOpen).Returns(true); serial.Setup(x => x.Write(It.IsAny <byte[]>(), It.IsAny <int>(), It.IsAny <int>())) .Callback((byte[] b, int o, int c) => { actual = b; }); ioThread.StartConnection(serial.Object, null); p.OnTimedCommand(cmd1, cmd2, 2000); Thread.Sleep(IOThread.AckWaitMillis - 10); byte[] expected1 = { 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x03, 0x06, 0xB0, 0xA3, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF }; Assert.AreEqual(expected1, actual); Thread.Sleep(2000 - IOThread.AckWaitMillis - 10); byte[] expected2 = { 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x03, 0x06, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF }; Assert.AreEqual(expected2, actual); ioThread.StopConnection(); }
public void InCompleted(SocketError socketError, int bytesTransferred) { if (socketError != SocketError.Success) { if (socketError == SocketError.ConnectionReset || socketError == SocketError.NoBufferSpaceAvailable || socketError == SocketError.TooManyOpenSockets) { m_socket.EventAcceptFailed(m_endpoint, ErrorHelper.SocketErrorToErrorCode(socketError)); Accept(); } else { m_acceptedSocket.Dispose(); NetMQException exception = NetMQException.Create(socketError); m_socket.EventAcceptFailed(m_endpoint, exception.ErrorCode); throw exception; } } else { // TODO: check TcpFilters m_acceptedSocket.NoDelay = true; // Utils.TuneTcpKeepalives(m_acceptedSocket, m_options.TcpKeepalive, m_options.TcpKeepaliveCnt, m_options.TcpKeepaliveIdle, m_options.TcpKeepaliveIntvl); // Create the engine object for this connection. StreamEngine engine = new StreamEngine(m_acceptedSocket, m_options, m_endpoint); // Choose I/O thread to run connecter in. Given that we are already // running in an I/O thread, there must be at least one available. IOThread ioThread = ChooseIOThread(m_options.Affinity); // Create and launch a session object. // TODO: send null in address parameter, is unneed in this case SessionBase session = SessionBase.Create(ioThread, false, m_socket, m_options, new Address(m_handle.LocalEndPoint)); session.IncSeqnum(); LaunchChild(session); SendAttach(session, engine, false); m_socket.EventAccepted(m_endpoint, m_acceptedSocket); Accept(); } }
public static void IOThread() { while (true) { IOThread.Sleep(10); if ((arduinoCOM.available) > 1) { for (int i = 1; i <= 2; i++) { incoming[i] = arduinoCOM.readByte(); } processIOThread(incoming[1], incoming[2]); } } }
public PgmSender([NotNull] IOThread ioThread, [NotNull] Options options, [NotNull] Address addr, bool delayedStart) : base(ioThread) { m_options = options; m_addr = addr; m_delayedStart = delayedStart; m_encoder = null; m_outBuffer = null; m_outBufferSize = 0; m_writeSize = 0; m_encoder = new V1Encoder(0, m_options.Endian); m_currentReconnectIvl = m_options.ReconnectIvl; m_state = State.Idle; }
/// <summary> /// This method is called when a message receive operation has been completed. /// </summary> /// <param name="socketError">a SocketError value that indicates whether Success or an error occurred</param> /// <param name="bytesTransferred">the number of bytes that were transferred</param> public void InCompleted(SocketError socketError, int bytesTransferred) { if (socketError != SocketError.Success) { m_socket.EventAcceptFailed(m_address.ToString(), socketError.ToErrorCode()); // dispose old object m_acceptedSocket.Handle.Dispose(); Accept(); } else { //This if-case only concerns bound PGM Subscribers after the Ethernet cable has been unplugged (Publisher on same host) //or plugged in again (Publisher on different host). if (m_address.InterfaceAddress != null) { try { m_acceptedSocket.Handle.SetSocketOption(PgmSocket.PgmLevel, PgmSocket.RM_ADD_RECEIVE_IF, m_address.InterfaceAddress.GetAddressBytes()); } catch { // dispose old object m_acceptedSocket.Handle.Dispose(); Accept(); return; } } m_acceptedSocket.InitOptions(); var pgmSession = new PgmSession(m_acceptedSocket, m_options); IOThread ioThread = ChooseIOThread(m_options.Affinity); SessionBase session = SessionBase.Create(ioThread, false, m_socket, m_options, new Address(m_handle.LocalEndPoint)); session.IncSeqnum(); LaunchChild(session); SendAttach(session, pgmSession, false); m_socket.EventAccepted(m_address.ToString(), m_acceptedSocket.Handle); Accept(); } }
/// <summary> /// Create a new TcpConnector object. /// </summary> /// <param name="ioThread">the I/O-thread for this TcpConnector to live on.</param> /// <param name="session">the session that will contain this</param> /// <param name="options">Options that define this new TcpC</param> /// <param name="addr">the Address for this Tcp to connect to</param> /// <param name="delayedStart">this boolean flag dictates whether to wait before trying to connect</param> public TcpConnector([NotNull] IOThread ioThread, [NotNull] SessionBase session, [NotNull] Options options, [NotNull] Address addr, bool delayedStart) : base(ioThread, options) { this.m_ioObject = new IOObject(ioThread); this.m_addr = addr; this.m_s = null; this.m_handleValid = false; this.m_delayedStart = delayedStart; this.m_timerStarted = false; this.m_session = session; this.m_currentReconnectIvl = this.m_options.ReconnectIvl; Debug.Assert(this.m_addr != null); this.m_endpoint = this.m_addr.ToString(); this.m_socket = session.Socket; }
public TcpConnecter(IOThread ioThread, SessionBase session, Options options, Address addr, bool delayedStart) : base(ioThread, options) { m_ioObject = new IOObject(ioThread); m_addr = addr; m_s = null; m_handleValid = false; m_delayedStart = delayedStart; m_timerStarted = false; m_session = session; m_currentReconnectIvl = m_options.ReconnectIvl; Debug.Assert(m_addr != null); m_endpoint = m_addr.ToString(); m_socket = session.Socket; }
protected override void ProcessSolvePartialProblemsMessage(SolvePartialProblemsMessage message) { var partialProblemsHelper = new PartialProblemsHelper(message); foreach (var partialProblem in partialProblemsHelper.Problems) { var thread = new IOThread() { TaskId = partialProblem.TaskId, ProblemInstanceId = message.Id, ProblemType = message.ProblemType, State = EState.Busy, RealThread = new Thread(() => SolvePartialProblem(partialProblemsHelper, partialProblem)) }; _runningThreads.Add(thread); thread.RealThread.Start(); } }
public static void Main(string[] args) { PreferenceManager manager = PreferenceManager.Manager; TestStandMapping mapping = new TestStandMapping(); Session session = new Session(mapping); DataStore dataStore = new DataStore(session); LogThread logThread = new LogThread(dataStore); _isUsingSimulatedSerialPort = args.Length > 0 && args[0].ToLower().Equals("sim"); IOThread ioThread = new IOThread(dataStore, ref session); UserInterface ui = new UserInterface(ref session); Program p = new Program(dataStore, logThread, ioThread, ui); }
public void StatusMessageSerializationTest() { IOThread ioThread = new IOThread { State = EState.Busy, ProblemInstanceId = 123L, ProblemType = "ProblemType", TaskId = 321L }; var threadList = new List <IOThread>(); threadList.Add(ioThread); var registerStatusMessage = new StatusMessage(123L, threadList); var result = registerStatusMessage.SerializeToXml(); Assert.IsNotNull(result); Assert.AreNotEqual(0, result.Length); var xmlValidator = new XmlValidator(); var xsdSchemaFile = "StatusMessage.xsd"; var xsdSchemaPath = Path.Combine(_xsdSchemasPath, xsdSchemaFile); var validationResult = xmlValidator.Validate(result, xsdSchemaPath, true); var errorsCount = validationResult.Errors.Count + validationResult.Warnings.Count; Assert.AreEqual(0, errorsCount); #region ExampleResult //<?xml version="1.0" encoding="utf-16"?> //<Status xmlns="http://www.mini.pw.edu.pl/ucc/"> // <Id>123</Id> // <Threads> // <IOThread> // <State>Busy</State> // <HowLong>00:00:00</HowLong> // <ProblemInstanceId>123</ProblemInstanceId> // <TaskId>321</TaskId> // <ProblemType>ProblemType</ProblemType> // </IOThread> // </Threads> //</Status> #endregion }
void IEngine.Plug(IOThread ioThread, SessionBase session) { m_session = session; m_ioObject = new IOObject(null); m_ioObject.SetHandler(this); m_ioObject.Plug(ioThread); m_ioObject.AddSocket(m_handle); DropSubscriptions(); var msg = new Msg(); msg.InitEmpty(); // push message to the session because there is no identity message with pgm session.PushMsg(ref msg); m_state = State.Receiving; BeginReceive(); }
protected override void ProcessDivideProblemMessage(DivideProblemMessage message) { if (SolvableProblems.FirstOrDefault(x => x == message.ProblemType) == null) { EventLogger.GetLog().ErrorFormat("Nie obsługiwany problem: {0}", message.ProblemType); return; } TaskSolver taskSolver = null; switch (message.ProblemType) { case ("MultiplyProblem"): taskSolver = new MultiplyTaskSolver(message.Data); break; case ("DVRP"): taskSolver = new DllProject.DvrpTaskSolver(message.Data); break; } var problemSolvingHelper = new ProblemSolvingHelper() { ProblemId = message.Id, ProblemType = message.ProblemType, TaskSolver = taskSolver, }; _problems.Add(message.Id, problemSolvingHelper); taskSolver.ProblemDividingFinished += taskSolver_ProblemDividingFinished; taskSolver.SolutionsMergingFinished += taskSolver_SolutionsMergingFinished; var thread = new IOThread { ProblemType = message.ProblemType, State = EState.Busy, RealThread = new Thread(() => DivideProblem(message, taskSolver)), ProblemInstanceId = message.Id }; _runningThreads.Add(thread); thread.RealThread.Start(); }
void IEngine.Plug(IOThread ioThread, SessionBase session) { this.m_session = session; this.m_ioObject = new IOObject(null); this.m_ioObject.SetHandler(this); this.m_ioObject.Plug(ioThread); this.m_ioObject.AddSocket(this.m_handle); this.DropSubscriptions(); Msg msg = new Msg(); msg.InitEmpty(); // push message to the session because there is no identity message with pgm session.PushMsg(ref msg); this.m_state = State.Receiving; this.BeginReceive(); }
public void Plug(IOThread ioThread, SessionBase session) { m_encoder.SetMsgSource(session); // get the first message from the session because we don't want to send identities var msg = new Msg(); msg.InitEmpty(); bool ok = session.PullMsg(ref msg); if (ok) { msg.Close(); } AddSocket(m_socket); m_state = State.Connecting; m_socket.Connect(m_pgmAddress.Address); }
public void Plug(IOThread ioThread, SessionBase session) { m_encoder.SetMsgSource(session); // get the first message from the session because we don't want to send identities var msg = new Msg(); msg.InitEmpty(); bool ok = session.PullMsg(ref msg); if (ok) { msg.Close(); } AddSocket(m_socket); m_state = State.Connecting; m_socket.Connect(m_pgmAddress.Address); }
public void Plug(IOThread ioThread, SessionBase session) { Debug.Assert(!m_plugged); m_plugged = true; // Connect to session object. Debug.Assert(m_session == null); Debug.Assert(session != null); m_session = session; m_socket = m_session.Socket; m_ioObject = new IOObject(null); m_ioObject.SetHandler(this); // Connect to I/O threads poller object. m_ioObject.Plug(ioThread); m_ioObject.AddSocket(m_handle); m_ioEnabled = true; FeedAction(Action.Start, SocketError.Success, 0); }
public void Verify_Solenoid_Close_Command() { TestStandMapping mapping = new TestStandMapping(); Session session = new Session(mapping); DataStore dataStore = new DataStore(session); Mock <IUserInterface> ui = new Mock <IUserInterface>(); Mock <LogThread> logThread = new Mock <LogThread>(dataStore); IOThread ioThread = new IOThread(dataStore, ref session); Program p = new Program(dataStore, logThread.Object, ioThread, ui.Object); SolenoidCommand sc = new SolenoidCommand(3, false); byte[] actual = {}; Mock <ISerialPort> serial = new Mock <ISerialPort>(); serial.Setup(x => x.IsOpen).Returns(true); serial.Setup(x => x.Write(It.IsAny <byte[]>(), It.IsAny <int>(), It.IsAny <int>())) .Callback((byte[] b, int o, int c) => { actual = b; }); ioThread.StartConnection(serial.Object, null); p.OnCommand(sc); Thread.Sleep(IOThread.AckWaitMillis - 10); ioThread.StopConnection(); byte[] expected = { 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x03, 0x03, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF }; Assert.AreEqual(expected, actual); }
private void SolvePartialProblem(PartialProblemsHelper partialProblemsHelper, PartialProblem partialProblem) { var taskSolver = GetProperTaskSolver(partialProblemsHelper.ProblemType, partialProblem.Data); byte[] solution = taskSolver.Solve(partialProblem.Data, new TimeSpan(100000, 0, 0, 0)); //TODO: Ogarnac te timeouty bool dziaa = false; IOThread thread = null; while (!dziaa) { try { thread = _runningThreads.FirstOrDefault(x => x.TaskId == partialProblem.TaskId); thread.State = EState.Idle; dziaa = true; } catch (Exception) { } } partialProblemsHelper.Solutions.Add(new Solution(partialProblem.TaskId, false, ESolutionType.Partial, thread.HowLong, solution)); //TODO: Ogarnac te timeouty też if (partialProblemsHelper.Solutions.Count == partialProblemsHelper.Problems.Count) //Wszystkie rozwiazania policzone { SolutionsMessage solutionsMessage = new SolutionsMessage(partialProblemsHelper.ProblemType, partialProblemsHelper.ProblemId, partialProblemsHelper.Message.CommonData, partialProblemsHelper.Solutions); SendMessage(solutionsMessage.Serialize()); } lock (_runningThreadsLockObject) { _runningThreads.Remove(thread); } }
public void Verify_Tare() { TestStandMapping mapping = new TestStandMapping(); Session session = new Session(mapping); DataStore dataStore = new DataStore(session); Mock <IUserInterface> ui = new Mock <IUserInterface>(); Mock <LogThread> logThread = new Mock <LogThread>(dataStore); IOThread ioThread = new IOThread(dataStore, ref session); Program p = new Program(dataStore, logThread.Object, ioThread, ui.Object); LoadComponent l = (mapping.ComponentsByID()[0] as LoadComponent); Assert.AreEqual(0, l.Newtons()); l.Set(10); Assert.AreEqual(18.83217116, l.Newtons(), 0.01); l.Tare(); l.Set(10); Assert.AreEqual(0, l.Newtons(), 0.01); l.Set(200); Assert.AreEqual(357.8112522, l.Newtons(), 0.01); }
public void Plug(IOThread ioThread, SessionBase session) { Debug.Assert(!m_plugged); m_plugged = true; // Connect to session object. Debug.Assert(m_session == null); Debug.Assert(session != null); m_session = session; m_socket = m_session.Socket; m_ioObject = new IOObject(null); m_ioObject.SetHandler(this); // Connect to I/O threads poller object. m_ioObject.Plug(ioThread); m_ioObject.AddSocket(m_handle); m_ioEnabled = true; FeedAction(Action.Start, SocketError.Success, 0); }
public IpcConnector(IOThread ioThread, SessionBase session, Options options, Address addr, bool wait) : base(ioThread, session, options, addr, wait) { }
public ReqSession( IOThread ioThread, bool connect, SocketBase socket, Options options, Address addr) : base(ioThread, connect, socket, options, addr) { m_state = State.Identity; }
public RouterSession([NotNull] IOThread ioThread, bool connect, [NotNull] SocketBase socket, [NotNull] Options options, [NotNull] Address addr) : base(ioThread, connect, socket, options, addr) { }
public IpcConnecter(IOThread ioThread, SessionBase session, Options options, Address addr, bool wait) : base(ioThread, session, options, addr, wait) { }
public RepSession( IOThread ioThread, bool connect, SocketBase socket, Options options, Address addr) : base(ioThread, connect, socket, options, addr) {}
/// <summary> /// Create a new TcpConnector object. /// </summary> /// <param name="ioThread">the I/O-thread for this TcpConnector to live on.</param> /// <param name="session">the session that will contain this</param> /// <param name="options">Options that define this new TcpC</param> /// <param name="addr">the Address for this Tcp to connect to</param> /// <param name="delayedStart">this boolean flag dictates whether to wait before trying to connect</param> public TcpConnector( IOThread ioThread, SessionBase session, Options options, Address addr, bool delayedStart) : base(ioThread, options) { m_ioObject = new IOObject(ioThread); m_addr = addr; m_s = null; m_handleValid = false; m_delayedStart = delayedStart; m_timerStarted = false; m_session = session; m_currentReconnectIvl = m_options.ReconnectIvl; Debug.Assert(m_addr != null); m_endpoint = m_addr.ToString(); m_socket = session.Socket; }
/// <summary> /// Create a new IpcListener with the given IOThread, socket, and Options. /// </summary> /// <param name="ioThread"></param> /// <param name="socket">the SocketBase to listen to</param> /// <param name="options">an Options value that dictates the settings for this IpcListener</param> public IpcListener( IOThread ioThread, SocketBase socket, Options options) : base(ioThread, socket, options) { m_address = new IpcAddress(); }