Click here to Skip to main content
15,891,431 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Questionsending bytes from a pc to another using udp in vbwinsock (vb 2008) Pin
ibtissamshukor7-Apr-10 19:51
ibtissamshukor7-Apr-10 19:51 
AnswerRe: sending bytes from a pc to another using udp in vbwinsock (vb 2008) Pin
Abhinav S7-Apr-10 20:05
Abhinav S7-Apr-10 20:05 
AnswerRe: sending bytes from a pc to another using udp in vbwinsock (vb 2008) Pin
Rajesh Anuhya12-Apr-10 2:14
professionalRajesh Anuhya12-Apr-10 2:14 
AnswerRe: sending bytes from a pc to another using udp in vbwinsock (vb 2008) Pin
Michel Godfroid14-Apr-10 12:22
Michel Godfroid14-Apr-10 12:22 
QuestionDataReader.Read not working? [Solved] Pin
B-rad A7-Apr-10 11:15
B-rad A7-Apr-10 11:15 
AnswerRe: DataReader.Read not working? Pin
Pete O'Hanlon7-Apr-10 11:49
mvePete O'Hanlon7-Apr-10 11:49 
AnswerRe: DataReader.Read not working? Pin
jaypatel51211-Apr-10 1:56
jaypatel51211-Apr-10 1:56 
Questionthreading: always call delegate.EndInvoke? Pin
Mr.PoorEnglish7-Apr-10 10:30
Mr.PoorEnglish7-Apr-10 10:30 
Hi audience!

on several places ther is demanded in a very unconditional manner: "when starting a thread with aDelegate.BeginInvoke() always call the corresponding aDelegate.EndInvoke(IAsyncResult ar).


For example see MSDN itself [ ^ ] .

But now i look in Reflector, how the Backgroundworker-class works, and i find:
C#
public void RunWorkerAsync(object argument)
{
    if (this.isRunning)
    {
        throw new InvalidOperationException(SR.GetString("BackgroundWorker_WorkerAlreadyRunning"));
    }
    this.isRunning = true;
    this.cancellationPending = false;
    this.asyncOperation = AsyncOperationManager.CreateOperation(null);
    this.threadStart.BeginInvoke(argument, null, null);
}

And this.threadStart is simply a private class-variable of type WorkerThreadStartDelegate, which is defined as:
C#
private delegate void WorkerThreadStartDelegate(object argument);

Since
C#
this.threadStart.BeginInvoke(argument, null, null);

does not save the returned IAsyncResult, nor passes an AsyncCallback to the BeginInvoke()-call, i see no option for the backgroundworker, to call this.threadStart.EndInvoke(IAsyncResult ar) propperly.



So i think to myself: if the parallel processed method is void, actually there is no need to call aDelegate.EndInvoke(IAsyncResult ar)?

I would be pleased of that, because that could simplyfy some of my codes.


So can anyone confirm my conclusion?
AnswerRe: threading: always call delegate.EndInvoke? Pin
Alan N8-Apr-10 3:55
Alan N8-Apr-10 3:55 
GeneralRe: threading: always call delegate.EndInvoke? Pin
Mr.PoorEnglish10-Apr-10 4:33
Mr.PoorEnglish10-Apr-10 4:33 
QuestionHow to pass value from Datagrid column to floating div column Pin
GladysRajan7-Apr-10 9:25
GladysRajan7-Apr-10 9:25 
QuestionExplorer Integration Pin
Jaymie7-Apr-10 2:42
Jaymie7-Apr-10 2:42 
AnswerRe: Explorer Integration Pin
Dave Kreskowiak7-Apr-10 4:51
mveDave Kreskowiak7-Apr-10 4:51 
Questionvb.net graphics, hue overlay? Pin
lilx2k6-Apr-10 20:50
lilx2k6-Apr-10 20:50 
AnswerRe: vb.net graphics, hue overlay? Pin
Dave Kreskowiak7-Apr-10 4:33
mveDave Kreskowiak7-Apr-10 4:33 
QuestionHelp needed saving an XML document from a VC++ 2008 .NET app Pin
Ger Hayden6-Apr-10 6:19
Ger Hayden6-Apr-10 6:19 
AnswerRe: Help needed saving an XML document from a VC++ 2008 .NET app Pin
Not Active6-Apr-10 8:46
mentorNot Active6-Apr-10 8:46 
AnswerRe: Help needed saving an XML document from a VC++ 2008 .NET app Pin
Estys7-Apr-10 1:25
Estys7-Apr-10 1:25 
GeneralRe: Help needed saving an XML document from a VC++ 2008 .NET app Pin
Ger Hayden7-Apr-10 23:24
Ger Hayden7-Apr-10 23:24 
QuestionSave Listview by Groups Pin
CeremBeyazit5-Apr-10 7:18
CeremBeyazit5-Apr-10 7:18 
QuestionGDI+ Architect Alternative? Pin
Som Shekhar3-Apr-10 8:36
Som Shekhar3-Apr-10 8:36 
Questionhow to programmatically get a list of resource file names in solution explorer [modified] Pin
fjparisIII2-Apr-10 23:46
fjparisIII2-Apr-10 23:46 
AnswerRe: how to programmatically get a list of resource file names in solution explorer Pin
Alan N3-Apr-10 10:21
Alan N3-Apr-10 10:21 
GeneralRe: how to programmatically get a list of resource file names in solution explorer Pin
fjparisIII3-Apr-10 10:46
fjparisIII3-Apr-10 10:46 
GeneralRe: how to programmatically get a list of resource file names in solution explorer Pin
Alan N3-Apr-10 13:32
Alan N3-Apr-10 13:32 

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.