Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Insolence on December 26, 2007, 05:47 PM

Title: [C#] SocketAsyncEventArgs
Post by: Insolence on December 26, 2007, 05:47 PM
http://pastebin.com/m64952e9

For some reason, SendBN/Listen are getting all jumbled up -- I think I need to use only 1 SocketAsyncEventArgs throughout my program, but how do I do that?  The examples on MSDN are little bit over my head.

I keep getting a "OperationAborted" exception thrown in the Listen method.  Also, my friend tells me I can't expect to always get full packets--how should I handle this?  I know what the length of each packet should be, but I'm not sure how I should "queue" the bytes up (thread) safely.

I think I'm being a bit too vague, but I'm unsure exactly what to ask for--please ask questions about my code! :)

Thanks for any replies.

PS
Apparently I should only ever receive the first 2 bytes, and then from that decide how much I'll need to receive to get a complete packet--how should I go about that?
Title: Re: [C#] SocketAsyncEventArgs
Post by: Insolence on December 26, 2007, 11:05 PM
I put the listen stuff in a new thread and that seemed to do it.

Sorry to waste your time :)
Title: Re: [C#] SocketAsyncEventArgs
Post by: MysT_DooM on December 27, 2007, 11:54 AM
Apology accepted.