Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 604437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:02:18+00:00 2026-05-13T17:02:18+00:00

i have using WCF service in my code that the client(WindowsFormsApplication1) capturing desktop view

  • 0

i have using WCF service in my code that the client(WindowsFormsApplication1) capturing desktop view and send it to Server .. After that the Server will send the images to Masterclient(windowsformsApplication2).Its working… but few minutes i got the exception from clientSide as object reference is not to set an instance of an object How can i solve this problem….

and this is mycode:

public void SendToServerToMainServer(clsImageObject img)
{

        ConnectToServerSettings();
        InterfaceClass.IService serviceobj = Client.CreateChannel();// I   got  exception in This line,And the serviceobj got null Suddenly...
        serviceobj.SendToServerToMasterClient(img, clpro.MyIPAddress);
        Client.Close();
        Client = null;
    }
    }




public void ConnectToServerSettings()
{

        string StrAddress = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "url1.txt");
        //EndpointAddress ea = new EndpointAddress(@"net.tcp://10.0.3.33:2222/ClsPCMain");
        EndpointAddress ea = new EndpointAddress(StrAddress);
        NetTcpBinding binding = new NetTcpBinding(SecurityMode.None, false);
        //binding.TransferMode = TransferMode.Streamed;
        binding.MaxBufferPoolSize = Int32.MaxValue;
        binding.MaxReceivedMessageSize = Int32.MaxValue;
        binding.PortSharingEnabled = true;
        binding.ReceiveTimeout = TimeSpan.MaxValue;
        binding.SendTimeout = TimeSpan.MaxValue;
        binding.OpenTimeout = TimeSpan.MaxValue;
        binding.CloseTimeout = TimeSpan.MaxValue;
        binding.MaxReceivedMessageSize = Int32.MaxValue;
        binding.MaxBufferPoolSize = Int32.MaxValue;
        binding.MaxConnections = Int16.MaxValue;
        binding.ReaderQuotas.MaxArrayLength = Int32.MaxValue;
        binding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue;
        binding.ReaderQuotas.MaxDepth = Int32.MaxValue;
        binding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue;
        binding.ReaderQuotas.MaxStringContentLength = Int32.MaxValue;
        binding.Security.Mode = SecurityMode.None;
        Client = new ChannelFactory<InterfaceClass.IService>(binding, ea);

    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:02:18+00:00Added an answer on May 13, 2026 at 5:02 pm

    try closing your channel after use

    using (InterfaceClass.IService serviceobj = Client.CreateChannel())
    {
        serviceobj.SendToServerToMasterClient(img, clpro.MyIPAddress);
        serviceobj.Close();
        Client.Close();
        Client = null;
    }
    

    tbh, i’m not sure this code is clean. You seem to be using a class (instance?) variable ‘Client’ which you fill in 1 method, and close&clear in other. Without to much code rewrite, i would modify the signature of the ‘ConnectToServerSettings()’ to return the Client instance instead of pushing it in a variable.

    Hope this helps,

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 500k
  • Answers 500k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Seems like you already received an answer to this question… May 16, 2026 at 1:52 pm
  • Editorial Team
    Editorial Team added an answer Have a look at CQRS; notion would be that you… May 16, 2026 at 1:52 pm
  • Editorial Team
    Editorial Team added an answer You need to include all of the significant un-aggregated columns… May 16, 2026 at 1:52 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have simple chat program using WCF service. One service use for server and
A WCF service is based on NetTcpBinding. It may happen that a client silently
I have a .Net DLL that I created that implements a WCF client that
please help me solve this issue. I have a client using WCF. I don't
I have a WCF service using BasicHttpBinding with Windows authentication. Most clients are domain
here's the setup for the project. I have a WCF Service that is hosted
I am using VS 2008. I have to create a wcf service and inside
I have built a WCF Service that is being consumed by a Silverlight app.
I have a MVC website that sits on top of a WCF service. The
I have a WCF service which accepts a string as a paramter for one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.