Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: .NET and "industrial espionage" Pin
Marc Clifton10-Feb-04 6:33
mvaMarc Clifton10-Feb-04 6:33 
GeneralRe: .NET and "industrial espionage" Pin
Palladino10-Feb-04 8:06
Palladino10-Feb-04 8:06 
GeneralRe: .NET and "industrial espionage" Pin
Marc Clifton10-Feb-04 8:38
mvaMarc Clifton10-Feb-04 8:38 
GeneralRe: .NET and "industrial espionage" Pin
Palladino11-Feb-04 3:51
Palladino11-Feb-04 3:51 
GeneralRe: .NET and "industrial espionage" Pin
Palladino12-Feb-04 5:42
Palladino12-Feb-04 5:42 
GeneralTesting .NET remote connection Pin
naxos10-Feb-04 3:53
naxos10-Feb-04 3:53 
GeneralRe: Testing .NET remote connection Pin
Marc Clifton10-Feb-04 4:10
mvaMarc Clifton10-Feb-04 4:10 
GeneralCannot abort thread Pin
Mertli Ozgur Nevres10-Feb-04 3:38
Mertli Ozgur Nevres10-Feb-04 3:38 
Hi all,

I wrote a multi-thread application using sockets. But when i attempt to stop a thread, the thread is falling into "AbortRequested" state but never being aborted. Can anyone help me?
My code is below:

if ( this.m_ReceiveThread.IsAlive )
MessageBox.Show( "alive" );
MessageBox.Show( "State: " + this.m_ReceiveThread.ThreadState.ToString() );

if ( this.m_ReceiveThread != null )
{
for ( int i = 0; i <= 10; i++ )
{
try
{
this.m_ReceiveThread.Abort();
this.m_ReceiveThread.Join( 100 );

/*
!!!!!! it always says current state is AbortRequested !!!!!!
*/
MessageBox.Show( "m_ReceiveThread trying to abort. - " + i.ToString()
+ "\nCurrentState: " + this.m_ReceiveThead.ThreadState.ToString() );
}//End of try.
catch
{
}//End of catch.

if ( this.m_ReceiveThread.ThreadState == ThreadState.Aborted
|| this.m_ReceiveThread.ThreadState == ThreadState.Stopped )
{
MessageBox.Show( "m_ReceiveThread aborted." );
break;
}//End of if ( this.m_ReceiveThread.ThreadState == ThreadState.Aborted ).
}//End of for( int i = 0; i <= 10; i++ ).
}// End of if ( this.m_ReceiveThread != null ).
GeneralRe: Cannot abort thread Pin
Marc Clifton10-Feb-04 3:59
mvaMarc Clifton10-Feb-04 3:59 
GeneralRe: Cannot abort thread Pin
Kentamanos10-Feb-04 6:04
Kentamanos10-Feb-04 6:04 
GeneralRe: Cannot abort thread Pin
Marc Clifton10-Feb-04 6:24
mvaMarc Clifton10-Feb-04 6:24 
GeneralRe: Cannot abort thread Pin
David Stone10-Feb-04 9:06
sitebuilderDavid Stone10-Feb-04 9:06 
GeneralRe: Cannot abort thread Pin
Marc Clifton10-Feb-04 9:38
mvaMarc Clifton10-Feb-04 9:38 
GeneralRe: Cannot abort thread Pin
David Stone10-Feb-04 10:36
sitebuilderDavid Stone10-Feb-04 10:36 
GeneralRe: Cannot abort thread Pin
Marc Clifton10-Feb-04 13:40
mvaMarc Clifton10-Feb-04 13:40 
Questionhow to draw a X coordinate with a series of datetime data? Pin
Member 185560810-Feb-04 3:22
Member 185560810-Feb-04 3:22 
AnswerRe: how to draw a X coordinate with a series of datetime data? Pin
Alex Korchemniy10-Feb-04 7:20
Alex Korchemniy10-Feb-04 7:20 
Generalinteract 2 way Pin
Blue_Aqua10-Feb-04 3:14
Blue_Aqua10-Feb-04 3:14 
GeneralRe: interact 2 way Pin
Heath Stewart10-Feb-04 11:10
protectorHeath Stewart10-Feb-04 11:10 
GeneralRe: interact 2 way Pin
Blue_Aqua10-Feb-04 18:23
Blue_Aqua10-Feb-04 18:23 
GeneralMultyThreading in C#: Communication between threads Pin
Jasper4C#10-Feb-04 2:46
Jasper4C#10-Feb-04 2:46 
GeneralRe: MultyThreading in C#: Communication between threads Pin
Marc Clifton10-Feb-04 4:17
mvaMarc Clifton10-Feb-04 4:17 
GeneralRe: MultyThreading in C#: Communication between threads Pin
Jasper4C#10-Feb-04 12:08
Jasper4C#10-Feb-04 12:08 
GeneralRe: MultyThreading in C#: Communication between threads Pin
Marc Clifton10-Feb-04 13:38
mvaMarc Clifton10-Feb-04 13:38 
GeneralBackground compile in C# Pin
mufoxe10-Feb-04 2:24
mufoxe10-Feb-04 2:24 

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.