Esempio n. 1
0
        // Default constructor
        public OSServer(Settings intSettings)
        {
            exceptionthrown = false;

            // First we set up our mutex and semaphore
            mutex = new Mutex();
            numconnections = 0;

            // Then we create our stack of read sockets
            socketpool = new OSAsyncEventStack(Convert.ToInt32(intSettings.NumConnect));
            // Now we create enough read sockets to service the maximum number of clients
            // that we will allow on the server
            // We also assign the event handler for IO Completed to each socket as we create it
            // and set up its buffer to the right size.
            // Then we push it onto our stack to wait for a client connection
            for (Int32 i = 0; i < Convert.ToInt32(intSettings.NumConnect); i++)
            {
                SocketAsyncEventArgs item = new SocketAsyncEventArgs();
                item.Completed += new EventHandler<SocketAsyncEventArgs>(OnIOCompleted);
                item.SetBuffer(new Byte[Convert.ToInt32(intSettings.BufferSize)], 0, Convert.ToInt32(intSettings.BufferSize));
                socketpool.Push(item);
            }

            // Create the Mllp Helper object here
            hl7 hl7 = new hl7();


        }
Esempio n. 2
0
        // Default constructor
        public OSServer()
        {
            exceptionthrown = false;

            // First we set up our mutex and semaphore
            mutex          = new Mutex();
            numconnections = 0;

            // Then we create our stack of read sockets
            socketpool = new OSAsyncEventStack(DEFAULT_MAX_CONNECTIONS);

            // Now we create enough read sockets to service the maximum number of clients
            // that we will allow on the server
            // We also assign the event handler for IO Completed to each socket as we create it
            // and set up its buffer to the right size.
            // Then we push it onto our stack to wait for a client connection
            for (Int32 i = 0; i < DEFAULT_MAX_CONNECTIONS; i++)
            {
                SocketAsyncEventArgs item = new SocketAsyncEventArgs();
                item.Completed += new EventHandler <SocketAsyncEventArgs>(OnIOCompleted);
                item.SetBuffer(new Byte[DEFAULT_BUFFER_SIZE], 0, DEFAULT_BUFFER_SIZE);
                socketpool.Push(item);
            }
        }
Esempio n. 3
0
        // Default constructor
        public OSServer()
        {
            exceptionthrown = false;

            // First we set up our mutex and semaphore
            mutex = new Mutex();
            numconnections = 0;

            // Then we create our stack of read sockets
            socketpool = new OSAsyncEventStack(DEFAULT_MAX_CONNECTIONS);

            // Now we create enough read sockets to service the maximum number of clients
            // that we will allow on the server
            // We also assign the event handler for IO Completed to each socket as we create it
            // and set up its buffer to the right size.
            // Then we push it onto our stack to wait for a client connection
            for (Int32 i = 0; i < DEFAULT_MAX_CONNECTIONS; i++)
            {
                SocketAsyncEventArgs item = new SocketAsyncEventArgs();
                item.Completed += new EventHandler<SocketAsyncEventArgs>(OnIOCompleted);
                item.SetBuffer(new Byte[DEFAULT_BUFFER_SIZE], 0, DEFAULT_BUFFER_SIZE);
                socketpool.Push(item);
            }
        }