AdrianSzymczak / jabber-net

Automatically exported from code.google.com/p/jabber-net
0 stars 0 forks source link

Closing a client that's still trying to connect #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Setup a jabber client to connect to some host that doesn't exist.  e.g 
"randomHost15F7389D"
Then wait a moment (the client still won't be connected), and tell it to close.

What is the expected output? What do you see instead?
One would expect to see the connection attempt immediately stop, and a call to 
the OnError 
method.  It seems to do nothing instead.

What version of the product are you using? On what operating system?
1.0.1 on Windows Vista.

Please provide any additional information below.

Original issue reported on code.google.com by robbieha...@gmail.com on 30 Mar 2008 at 7:30

GoogleCodeExporter commented 9 years ago
Are you calling close during the DNS lookup, or during the attempt to connect?  
I
assume during the DNS lookup by the use case you gave.

If the DNS query fails, then OnError fires, and no connection is made.  What 
happens
when the DNS query eventually returns for you?  I would expect OnError to still 
fire.

I'm having a hard time reproducing, since my DNS server is too fast. :)

Can you try compiling from source, and adding this bit of code to 
XmppStream.cs, at
the end of Close(bool clean), about line 991?

            else
            {
                FireOnError(new InvalidOperationException("Cannot close a socket
before it is open"));
            }

and see what happens?

Original comment by hil...@gmail.com on 31 Mar 2008 at 8:29