|
Used breakpoints, saw the values and they were correct.
newText was highlighted in red though when I got to the" chatView.Text = newText" (dont know what that means: VS2008).
myName = "test"
myText = "ETST13245"
newText "\r\Test\0\0\0\0\0\0\0: ETST13245\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" string
|
|
|
|
|
Member 3493799 wrote: \0\0\0\0\0\0\0
As soon as it's hitting the null char, the display is being truncated.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Cheers, that makes sense, will change it accordingly.
|
|
|
|
|
You are welcome. After yesterday's retardfest it is nice to have a real question to answer.
BTW My first port of call when code is not behaving is to debug the thing to smithereens until I find the problem. My second is a call for Port.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Opening a good old Port may be the solution to many a networking problem 
|
|
|
|
|
Hi all,
I have created a multi-threaded TCP/IP server. Each client connection runs in it's own thread.
The problem that I have it when I close the server and there are still clients connected. The thing is that the client threads remain active.
How can stop / dispose of the client threads so that the server can be closed for good?
Many thanks in advance
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
well you need to handle connections when you close down the server.
You should have a list of all connected clients, right?
so you will want to stop incomming connections.
then you can abort all client threads, preferable after sending information to the client about the shut down
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
musefan wrote: You should have a list of all connected clients, right?
Yes.
musefan wrote: then you can abort all client threads
The only thing is that the client threads spawn out of another thread that is listening for any incoming connections. If a new connection is accepted by the listen thread the listen thread spawns a new thread for that connections. Thus I do not have the handle to each of the client threads that have been spawned, well I think so anyway.
Many thanks for your response
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Did you use Socket.beginAccept?
|
|
|
|
|
well you may want to change it so you store you connections somewhere you can access.
you could try using a static collection of threads. that way they can be accessed from both your connection handling thread and you main thread.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Mmmm .... yes I think that can do the trick.
Is it possible to terminate a thread if one has the thread handle?
Thanks again
Regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
I assuming its system.Threading.Thread, you can use .Abort to end the thread.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
musefan wrote: I assuming its system.Threading.Thread
Yes.
Thanks
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi,
if all you need is for the server to be able to stop whenever it wants to, turn all the client-serving threads into background threads by setting their IsBackground property true. FYI: ThreadPool threads and BackgroundWorkers always are background threads, so they can't prevent your app from exiting.
however if you need to communicate with the clients about the imminent shutdown, obviously you would need to keep a list and provide the appropriate code.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Luc Pattyn wrote: threads by setting their IsBackground property true. FYI: ThreadPool threads and BackgroundWorkers always are background threads, so they can't prevent your app from exiting.
Thank you for the information. This has helped a lot.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
You're welcome.
PS: I'd rather not look like this:
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
http://www.pastey.net/110020[^]
The following link is a simple method I created for converting a Directory based string into a compatible Dos string.
It's not working as intended;
The idea was to convert:
C:\test\test this\Example Here\Test Again\
into
c:\test\"test this"\"Example Here"\"Test Again"\
instead the code turns it into
"C:\test\test this\Example Here\Test Again\"
Please help! I'm not sure where I'm going wrong
*richTextBox1.Text += Sections[i] + "\n" + "test";* was a debug line for me.
Thanks,
Colin
modified on Thursday, March 12, 2009 7:40 AM
|
|
|
|
|
I posted an alternative unmanaged method which handles this for you automatically in your previous topic
|
|
|
|
|
Hi,
I want to store a lot of sounds in a DirectSound buffer, so how can I do that? I've tried with buffer[][] but it doesn't work. There's an error message that I have to create a new instance! I've tried with:
for(int i = 1; i <= 6; i++)
{
buffer[i][0] = new Buffer("sound/" + i.ToString() + ".wav", device);
}
I think there's no problem with the path of the sound file, because i've tested it with an normal path.
Greeting shainsen
|
|
|
|
|
what is the error and post the declaration code of that 2D array. I guess you're getting Object reference not set to an instance of an object.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Yes that's the error. Should I first declarate all the field of the array?
Greetings shainsen
|
|
|
|
|
yes
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
Would it not be better to use a collection of Buffer? That way you can have as many as you need without wasting memory.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
i have selected the topic "monitoring system usage " in c#.net as my 6 month project topic.please describe modules of the topics and explain the project.
|
|
|
|