/// <summary>
 /// Default copy constructor
 /// </summary>
 /// <param name="b">the object to copy from</param>
 public ParallelServer(ParallelServer b)
     : base(b)
 {
     m_port = b.m_port;
     m_serverOps = b.m_serverOps;
     m_receiveType = b.m_receiveType;
 }
 private void btnStart_Click(object sender, EventArgs e)
 {
     if (btnStart.Text.CompareTo("Start")==0)
     {
         ParallelServerOps ops = new ParallelServerOps(this, tbPort.Text, this,null, ReceiveType.SEQUENTIAL);
         m_server.StartServer(ops);
     }
     else
     {
         m_server.StopServer();
     }
     
 }
 /// <summary>
 /// Start the server with given option
 /// </summary>
 /// <param name="ops">options</param>
 public void StartServer(ParallelServerOps ops)
 {
     if (ops == null)
         ops = ParallelServerOps.defaultServerOps;
     if (ops.CallBackObj == null)
         throw new NullReferenceException("callBackObj is null!");
     lock (m_generalLock)
     {
         m_serverOps = ops;
     }
     Start();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Start the server with given option
 /// </summary>
 /// <param name="ops">options</param>
 public void StartServer(ParallelServerOps ops)
 {
     if (ops == null)
         ops = ParallelServerOps.defaultServerOps;
     if (ops.Acceptor == null)
         throw new NullReferenceException("acceptor cannot be null!");
     lock (m_generalLock)
     {
         m_serverOps = ops;
     }
     Start();
 }