Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
Sheshagiri #1
Member since Jan 2017 · 13 posts · Location: India
Group memberships: Members
Show profile · Link to this post
Subject: Openconnection Method is getting called repeatedly
Hi,
I have Created a dll using Matrix.  This dll will be registered as a COM Component and I am calling the Openconnection and send message from Classic Asp Page.

Below is my code snippet in asp page
  1. function OpenOFConnection()
  2.     dim xmppDomainName,xmppServerName,adminServiceAccount,adminPassword,userListArr,touser,int_cnt
  3.     dim xmppPort : xmppPort = 5222
  4.     dim retryCount : retryCount =1
  5.     if objOpenFire.GetConnectionStatus() = "False" then
  6.      
  7.       ' Get the  XMPP Domain Name
  8.       xmppDomainName = GetXmppDomainNameFromDB
  9.       ' Get XMPP Server Name
  10.       xmppServerName = GetXmppServerNameFromDB
  11.       xmppPort = GetXmppServerPortFromDB
  12.       ' Get Service Account for Admin
  13.       adminServiceAccount = GetUserNameFromDB
  14.       ' Get the Password of Service Account
  15.       adminPassword = GetServiceAccountPassword(adminServiceAccount)
  16.       dim connected : connected=false
  17.       dim errMessage
  18.       dim resource,objWSHNetwork
  19.       on error resume next
  20.       Set objWSHNetwork = Server.CreateObject("WScript.Network")
  21.       resource = objWSHNetwork.ComputerName
  22.  
  23.       ' Create Boradcast Object
  24.       objOpenFire.Intialize xmppDomainName,adminServiceAccount,resource,adminPassword,xmppServerName,xmppPort
  25.       ' Open the connection
  26.       do while (OpenOFConnection = false)
  27.         objOpenFire.OpenConnection(null)
  28.         if objOpenFire.GetConnectionStatus  = "True" then
  29.           OpenOFConnection=true
  30.         end if
  31.      
  32.         if retryCount > 500 then
  33.           exit do
  34.         end if
  35.         retryCount = retryCount +1
  36.     loop
  37.    
  38.      
  39.    end if
  40.     on error goto 0
  41.    
  42. end function

Attached is my code snippet for dll.

In the Logs I always see

BroadCast : 9/2/2017 12:42:41 PM : Login Successful.
BroadCast : 9/2/2017 12:42:41 PM : Sending Message To.  xyz@xmppdomain.com
BroadCast : 9/2/2017 12:42:45 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:42:45 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:43:05 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:43:05 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:43:25 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:43:25 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:43:45 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:43:46 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:43:48 PM : Sending Message To. xyz@xmppdomain.com
BroadCast : 9/2/2017 12:44:06 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:44:06 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:44:26 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:44:26 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:44:46 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:44:46 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:45:06 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:45:06 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:45:26 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:45:26 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:45:46 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:45:46 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:46:06 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:46:06 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:46:26 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:46:26 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:46:46 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:46:46 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:47:06 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:47:06 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:47:26 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:47:26 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:47:46 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:47:47 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:48:07 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:48:07 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:48:27 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:48:27 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:48:47 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:48:47 PM : Session Error...The Open method cannot be called on an active stream.
BroadCast : 9/2/2017 12:49:07 PM : Not Connected.  Getting New Connection...
BroadCast : 9/2/2017 12:49:07 PM : Session Error...The Open method cannot be called on an active stream.

This means method openconnection is getting called even after successful login.  Could you please help me why Open Connection is getting called even after successful login
The author has attached one file to this post:
Matrix_Dll_Code.txt 7.1 kBytes
You have no permission to open this file.
This post was edited 3 times, last on 2017-09-03, 14:09 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
This message usually means that you try to open a connections which is already opened, or in progress of beeing connected.

  • Are you sure that every user of our webpage gets a new XmppClient instance?
  • Does your code call Open() twice under some conditions?

Alex
Avatar
Sheshagiri #3
Member since Jan 2017 · 13 posts · Location: India
Group memberships: Members
Show profile · Link to this post
We are having only one service account which will be used to for sending a message.  We are opening this service account connection open when the first time message is sent and subsequetnly uses the same connection for sending the other messages.

We are able to solve this issue by maintaining one state transition enum instead of using single boolean variable to check whether connection is established or not.

Thanks
Sheshagiri
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters: