Click here to Skip to main content
15,891,607 members
Home / Discussions / C#
   

C#

 
JokeRe: Do something X times Pin
0x3c07-Jun-09 0:14
0x3c07-Jun-09 0:14 
JokeRe: Do something X times Pin
Mycroft Holmes7-Jun-09 3:04
professionalMycroft Holmes7-Jun-09 3:04 
GeneralRe: Do something X times Pin
Luc Pattyn7-Jun-09 3:08
sitebuilderLuc Pattyn7-Jun-09 3:08 
AnswerRe: Do something X times Pin
saanj7-Jun-09 23:55
saanj7-Jun-09 23:55 
QuestionTCPListener/TCPClient -> Loops and a lot of CPU Usage! Pin
softwarejaeger6-Jun-09 22:28
softwarejaeger6-Jun-09 22:28 
AnswerRe: TCPListener/TCPClient -> Loops and a lot of CPU Usage! Pin
Rob Philpott6-Jun-09 22:35
Rob Philpott6-Jun-09 22:35 
GeneralRe: TCPListener/TCPClient -> Loops and a lot of CPU Usage! Pin
softwarejaeger7-Jun-09 1:05
softwarejaeger7-Jun-09 1:05 
GeneralRe: TCPListener/TCPClient -> Loops and a lot of CPU Usage! Pin
Luc Pattyn7-Jun-09 2:05
sitebuilderLuc Pattyn7-Jun-09 2:05 
Hi,

IMO you are wasting a lot of resources:
- what made you chose 100msec as your sampling period?
- why do you call connection.GetStream() every 100 msec?
- why do you call connection.ReceiveBufferSize every 100 msec?
- why do you allocate a new byte[] every 100 msec? can't you reuse it?
- why don't you use an event-driven mechanism, as provided by BeginRead (ignoring DataAvailable)?


softwarejaeger wrote:
all my loops looks like that


and why do you need that many loops?


Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: TCPListener/TCPClient -> Loops and a lot of CPU Usage! Pin
softwarejaeger9-Jun-09 2:34
softwarejaeger9-Jun-09 2:34 
GeneralRe: TCPListener/TCPClient -> Loops and a lot of CPU Usage! Pin
Luc Pattyn9-Jun-09 2:56
sitebuilderLuc Pattyn9-Jun-09 2:56 
GeneralRe: TCPListener/TCPClient -> Loops and a lot of CPU Usage! Pin
softwarejaeger9-Jun-09 4:08
softwarejaeger9-Jun-09 4:08 
GeneralRe: TCPListener/TCPClient -> Loops and a lot of CPU Usage! Pin
softwarejaeger9-Jun-09 4:57
softwarejaeger9-Jun-09 4:57 
GeneralRe: TCPListener/TCPClient -> Loops and a lot of CPU Usage! Pin
harold aptroot7-Jun-09 2:12
harold aptroot7-Jun-09 2:12 
QuestionHow to set focus to specified cell of Datagridview Pin
KIDYA6-Jun-09 21:16
KIDYA6-Jun-09 21:16 
AnswerRe: How to set focus to specified cell of Datagridview Pin
I Believe In GOD6-Jun-09 21:34
I Believe In GOD6-Jun-09 21:34 
GeneralRe: How to set focus to specified cell of Datagridview Pin
KIDYA6-Jun-09 21:42
KIDYA6-Jun-09 21:42 
QuestionSending sql Query string as parameter in User defined function Pin
mmdullah6-Jun-09 19:37
mmdullah6-Jun-09 19:37 
AnswerRe: Sending sql Query string as parameter in User defined function Pin
Mycroft Holmes6-Jun-09 21:27
professionalMycroft Holmes6-Jun-09 21:27 
AnswerRe: Sending sql Query string as parameter in User defined function Pin
I Believe In GOD6-Jun-09 21:58
I Believe In GOD6-Jun-09 21:58 
QuestionHow to lunch a console application from a form application Pin
nhack6-Jun-09 11:36
nhack6-Jun-09 11:36 
AnswerRe: How to lunch a console application from a form application Pin
I Believe In GOD6-Jun-09 12:20
I Believe In GOD6-Jun-09 12:20 
AnswerRe: How to launch a console application from a form application Pin
Alan N6-Jun-09 12:48
Alan N6-Jun-09 12:48 
GeneralRe: How to launch a console application from a form application Pin
nhack6-Jun-09 21:24
nhack6-Jun-09 21:24 
GeneralRe: How to launch a console application from a form application Pin
Alan N7-Jun-09 0:42
Alan N7-Jun-09 0:42 
GeneralRe: How to launch a console application from a form application Pin
nhack7-Jun-09 1:22
nhack7-Jun-09 1:22 

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.