• Welcome to Valhalla Legends Archive.
 

[C#] Connecting....

Started by iGotPropz, August 22, 2004, 01:41 PM

Previous topic - Next topic

iGotPropz

Hi, I am also coding a C# bot, have been going for about 2 weeks, then I found an old copy of Myndfyre's connect stashed way in the back of the forums, and modified it to my style (but it has his backbone structure). It compiles fine, but when I execute it to connect... ( I am using BeginConnect(), EndConnect() IAsyncResult systems)

This error occurs after I initiate the Connect(), and it leads off onto sock_Connected(IAsyncResult ar)

System.Net.Sockets.SocketException: Unknown error (0x274d)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at JediOps.JediForm.sock_Connected(IAsyncResult ar) in
c:\My Documents\SharpDevelop Projects\Battle.net Bot\MainForm.cs:line 470


Now I'm assuming it have to be with the s.BeginConnect(); AsyncCallBack mismatching with the s.EndConnect();. If you might happen to know why this occurs off hand, could you please tell me? Or if you would like to see the source code of those two, I'd be glad to show you and get your input.


Much thanks,

      -Matt/iGotPropz

MyndFyre

I find the mismatching analysis highly unlikely.  When you call EndConnect(), you specify an IAsyncResult parameter.  EncConnect compares the IAsyncResult with the one you get from calling BeginConnect() (it does this in case you just want to set up a thread for polling), and if they don't match, the message of the SocketException will actually say that they're mismatched.

Beyond that, I really can't help you.  Like it says, "Unknown error."  :/

Oh, and when using [ code ] [ /code ] tags, use lowercase.  ;)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

iGotPropz

Ok thanks, and thanks about the code thing, used to always typing my HTML in caps, so i did also for the code

MyndFyre

Quote from: iGotPropz on August 22, 2004, 02:50 PM
Ok thanks, and thanks about the code thing, used to always typing my HTML in caps, so i did also for the code

HTML in all caps?  Bad!  Go XHTML!  All lowercase!!!  :P
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.