Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / July 2007

Tip: Looking for answers? Try searching our database.

Program with HTTPListener is idling at 100% cpu...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom - 31 Jul 2007 02:11 GMT
Hey,

I have made a program, that simply runs as a tray icon in the
systemtray, providing a HTTP Server using HTTPListener.

I have one problem however, it idles at 70-100% cpu.

It could be 1 of 2 things:

1) In my Sub Main i have:

  Sub Main()
        While CloseProgram = False
            Application.DoEvents()
        End While
    End Sub

I didn't quite know how to do it otherwise (Stop the program closing as
its just a tray icon and no windows forms are present), or its

2) The HTTPListener being greedy.

Any Ideas?

Cheers
Armin Zingler - 31 Jul 2007 02:40 GMT
> Hey,
>
[quoted text clipped - 19 lines]
>
> Any Ideas?

Replace your loop by
   
   Application.Run

And instead of setting CloseProgram = True, call Application.ExitThread.

Armin
Tom - 31 Jul 2007 03:03 GMT
Thank you very much Armin, that information was very much appreciated :)

>> Hey,
>>
[quoted text clipped - 26 lines]
>
> Armin
Armin Zingler - 31 Jul 2007 11:27 GMT
> Thank you very much Armin, that information was very much appreciated :)

Was a pleasure :)

Armin

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.