Click here to Skip to main content
15,896,912 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problems with StreamWriter Class Pin
Guffa3-Aug-07 5:40
Guffa3-Aug-07 5:40 
GeneralRe: Problems with StreamWriter Class Pin
Luc Pattyn3-Aug-07 5:52
sitebuilderLuc Pattyn3-Aug-07 5:52 
QuestionHow can I use a parsed UDP byte stream to continually update a GUI form ? Pin
flyingnome3-Aug-07 4:07
flyingnome3-Aug-07 4:07 
AnswerRe: How can I use a parsed UDP byte stream to continually update a GUI form ? Pin
martin_hughes3-Aug-07 5:17
martin_hughes3-Aug-07 5:17 
GeneralRe: How can I use a parsed UDP byte stream to continually update a GUI form ? Pin
flyingnome3-Aug-07 5:36
flyingnome3-Aug-07 5:36 
GeneralRe: How can I use a parsed UDP byte stream to continually update a GUI form ? Pin
martin_hughes3-Aug-07 5:49
martin_hughes3-Aug-07 5:49 
GeneralRe: How can I use a parsed UDP byte stream to continually update a GUI form ? Pin
flyingnome3-Aug-07 6:11
flyingnome3-Aug-07 6:11 
GeneralRe: How can I use a parsed UDP byte stream to continually update a GUI form ? Pin
martin_hughes3-Aug-07 7:07
martin_hughes3-Aug-07 7:07 
Very good question - it caused me to wonder too!

Basically, when the asynchronous BeginReceive is called, you pass in a state object (which is the "state" instance of the UdpState class I knocked up). This is then received in the callback as the IAsyncResult's AsyncState property. Those two lines basically cast out the udpClient and endPoint contained in the AsyncState so that they can be used.

I'm still trying to figure it out, but I guess you could simply refer to the class level udpClient adn IPEndPoint variables here (the MSDN example didn't have these declared...), but given that what's going on here is asynchronous in nature, it's possible that those class variables could change between the async callback being called and any work actually being processed leading to very subtle bugs.




"It was the day before today.... I remember it like it was yesterday."

-Moleman


GeneralRe: How can I use a parsed UDP byte stream to continually update a GUI form ? Pin
flyingnome7-Aug-07 7:53
flyingnome7-Aug-07 7:53 
GeneralRe: How can I use a parsed UDP byte stream to continually update a GUI form ? Pin
martin_hughes7-Aug-07 12:30
martin_hughes7-Aug-07 12:30 
QuestionA error is difficult to understand Pin
nhathoang3-Aug-07 4:04
nhathoang3-Aug-07 4:04 
AnswerRe: A error is difficult to understand Pin
Colin Angus Mackay3-Aug-07 4:11
Colin Angus Mackay3-Aug-07 4:11 
AnswerRe: A error is difficult to understand Pin
Pete O'Hanlon3-Aug-07 4:14
mvePete O'Hanlon3-Aug-07 4:14 
GeneralRe: A error is difficult to understand Pin
nhathoang3-Aug-07 4:18
nhathoang3-Aug-07 4:18 
GeneralRe: A error is difficult to understand Pin
Pete O'Hanlon3-Aug-07 4:29
mvePete O'Hanlon3-Aug-07 4:29 
GeneralRe: A error is difficult to understand Pin
nhathoang3-Aug-07 7:35
nhathoang3-Aug-07 7:35 
AnswerRe: A error is difficult to understand Pin
Luc Pattyn3-Aug-07 5:56
sitebuilderLuc Pattyn3-Aug-07 5:56 
Questionhow to initiate a class stored in string variable Pin
Asif Rehman3-Aug-07 3:32
Asif Rehman3-Aug-07 3:32 
AnswerRe: how to initiate a class stored in string variable Pin
Guffa3-Aug-07 3:36
Guffa3-Aug-07 3:36 
AnswerRe: how to initiate a class stored in string variable Pin
Urs Enzler3-Aug-07 3:58
Urs Enzler3-Aug-07 3:58 
GeneralRe: how to initiate a class stored in string variable Pin
Asif Rehman3-Aug-07 4:31
Asif Rehman3-Aug-07 4:31 
GeneralRe: how to initiate a class stored in string variable Pin
CiNN3-Aug-07 7:55
CiNN3-Aug-07 7:55 
QuestionWhat is Threading ? Pin
Chintan.Desai3-Aug-07 2:49
Chintan.Desai3-Aug-07 2:49 
AnswerRe: What is Threading ? Pin
originSH3-Aug-07 2:55
originSH3-Aug-07 2:55 
GeneralRe: What is Threading ? Pin
Joseph Guadagno3-Aug-07 3:28
Joseph Guadagno3-Aug-07 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.