• Welcome to Valhalla Legends Archive.
 

[C#] SocketAsyncEventArgs

Started by Insolence, December 26, 2007, 05:47 PM

Previous topic - Next topic

Insolence

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?

Insolence

I put the listen stuff in a new thread and that seemed to do it.

Sorry to waste your time :)

MysT_DooM



vb6, something about that combination of numbers and letters is sexy