2 Replies Latest reply on Jun 25, 2018 3:11 AM by sathish kumar

    ZBR2956649 Zebra printer not connected with C#

    sathish kumar

      Dears,

      While connecting the zebra printer often we are getting this issue “Syste.Net.Sockets.SocketExceptions: No Connection could be made because the target machine activity refused”, but when we restart the printer, it’s working properly for some time, later same issue occurring. But when we check the printer status it's always stable with Ready state, I can able to make changes in setting and IP is also ping able.

      Our system try to connect the printer 5secs once, even same error has occurred until printer restart. We are using the basic socket C# code for this.

      Please find the attachment of C# code what we are using for connect the Printer.

        • Re: ZBR2956649 Zebra printer not connected with C#
          Robin West

          Hi Sathish, If you don't restart the printer and wait a little does the problem go away then as well?  Which line of the code do you get the exception on?

          • Re: ZBR2956649 Zebra printer not connected with C#
            sathish kumar

            Hi,

            No, problem persists until restart the printer, we waited more than an hour, but the same error.

             

            Also we are getting the error in the Try block(marked in bold) in our code, always we are checking the status before send to printer. But when we checked the printer IP, there is no issue in IP, it can ping and opened in browser.

             

            if (IsConnectedAviable(ZebraclientDom) == false)

                            {

                                try

                                {

                                    ZebraclientDom.Connect(epRemoteDom);

                                }

                                catch (Exception ex)

                                {

                                    rtxtLog.Text += "Printer Connect: " + System.DateTime.Now.ToString("yyyyMMddHHmmss") + " " + ex.Message.ToString() + "\n";

                                    throw;

                                    //MessageBox.Show(ex.ToString(), " btnConnect_Click ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);

                                }

                            }

             

            Awaiting for your valuable responds,

             

            Thanks in Advance,