+ Reply to Thread
Results 1 to 3 of 3

Thread: Client Frequent Disconnection

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unhappy Client Frequent Disconnection

    I had developed a windows application using C# (.Net). I am getting "Connection is null or not active" error very frequently. How to resolve this? Also, how to connect to the server back again from the client? Once the server connection is lost i am not able to send any kind of request to the server. Also, is there any setting that needs to be done server side to avoid this error?

    Please suggest me possible ways to resolve this issue.

  2. #2
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,214
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    If your client loses a connection, you have to create a fresh instance of ElectroServer and connect and login again before you can send any messages.

    Why are you losing your connection? I need more information to determine that. If it is after several minutes of the client not sending any messages at all, then odds are the client was idled off; in that case see Users are being disconnected by ES for how to avoid it.

    With the next release, a logout event handler will be able to determine whether the server kicked a user off.

    Are there any client errors in the logs right before you see the error about the connection being null or not active?

    Also, check to make sure that you aren't sending requests before you get a successful LoginResponse (and aren't sending a LoginRequest before you get a successful connection response).
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  3. #3
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,214
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    One more question: did you enable encryption? When encryption is enabled, the server drops the connection if there is any message supposedly from you that doesn't decrypt correctly, because it is a security risk - this could be a malicious user trying to send a bogus message.

    edit: yet another question: do you see any errors in the server logs when you lose your connection? If you send a request that causes an exception in the server logs, most of the time you will lose your connection.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts