Citric COM Port Closing Issue RRS feed

  • Question

  • I am using Serial Port to communicate with another windows application for transferring the data through Citrix-6.5.

    For the first time, everything works fine but after a while the port which was opened earlier gets closed automatically and throws an exception in Serial Port's "DataReceivedHandlerEvent". 

    Exception: Index was outside the bounds of the array

    Although it's quite a generic exception 

    private void DataReceivedHandler(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
                    System.IO.Ports.SerialPort sp = (System.IO.Ports.SerialPort)sender;
                    Byte[] inData = new Byte[sp.BytesToRead];

                    // read all available bytes from serial port in one chunk
                    sp.Read(inData, 0, inData.Length);

                    // parse all bytes read through BGLib parser
                    for (int i = 0; i < inData.Length; i++)


                catch (Exception ex)
                    throw ex;

    We have also tried to get the COM PORT details using WMI over Citrix6.5 version. But was not able to get it. Is there any other approach to get the COM PORT List  over Citrix6.5.

    Monday, October 3, 2016 3:47 PM

All replies

  • This forum is for help in writing CD/DVD-burning software so it get a post maybe every couple weeks... or maybe not. You may want to go to a forum that is closer to your question... and with better traffic.

    Visual C++ MVP

    Monday, October 3, 2016 10:15 PM