Keep formless app running for winsock use
Keep formless app running for winsock use
Keep formless app running for winsock use
Keep formless app running for winsock use
Keep formless app running for winsock use
Keep formless app running for winsock use Keep formless app running for winsock use Keep formless app running for winsock use Keep formless app running for winsock use Keep formless app running for winsock use Keep formless app running for winsock use Keep formless app running for winsock use Keep formless app running for winsock use
Keep formless app running for winsock use Keep formless app running for winsock use
Keep formless app running for winsock use
Go Back  Xtreme Visual Basic Talk > > > Keep formless app running for winsock use


Reply
 
Thread Tools Display Modes
  #1  
Old 03-22-2011, 09:52 PM
not2betrusted2 not2betrusted2 is offline
Freshman
 
Join Date: Mar 2009
Posts: 42
Default Keep formless app running for winsock use


How would I keep a program running that starts off in Sub Main and has no forms to keep the program running? After it connects via window socket, it closes. How would I keep the program running so the window socket can communicate with the host? I don't want to use the
Code:
Do
Doevents
Loop
Is there another way I can keep the program running without this code?
Reply With Quote
  #2  
Old 03-23-2011, 02:57 AM
PlausiblyDamp's Avatar
PlausiblyDampKeep formless app running for winsock use PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

If there is no UI to display then what do you have against running a loop to keep the project running?

The only thing I would say is you could ignore the DoEvents bit as well given you have no open windows to process incoming messages.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #3  
Old 03-23-2011, 11:51 AM
Cerian Knight's Avatar
Cerian KnightKeep formless app running for winsock use Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,191
Default

If you want the sub to idle more efficiently, use Sleep API (try 1 or, if necessary, 0 as a parameter) instead of (or in addition to, if required) DoEvents.

I'm not clear on how the loop will ever be allowed to terminate without some form of signaling or why the socket communication must remain dependent on an endless loop.
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
  #4  
Old 03-23-2011, 12:25 PM
OnErr0r's Avatar
OnErr0rKeep formless app running for winsock use OnErr0r is offline
Obsessive OPtimizer

Administrator
* Guru *
 
Join Date: Jun 2002
Location: Debug Window
Posts: 13,774
Default

You could create a message-only window with API and Async winsock API so no loop/polling would be necessary.
__________________
Quis custodiet ipsos custodues.
Reply With Quote
  #5  
Old 04-11-2011, 05:38 PM
not2betrusted2 not2betrusted2 is offline
Freshman
 
Join Date: Mar 2009
Posts: 42
Default

how do you create a message-only window?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Keep formless app running for winsock use
Keep formless app running for winsock use
Keep formless app running for winsock use Keep formless app running for winsock use
Keep formless app running for winsock use
Keep formless app running for winsock use
Keep formless app running for winsock use Keep formless app running for winsock use Keep formless app running for winsock use Keep formless app running for winsock use Keep formless app running for winsock use Keep formless app running for winsock use Keep formless app running for winsock use
Keep formless app running for winsock use
Keep formless app running for winsock use
 
Keep formless app running for winsock use
Keep formless app running for winsock use
 
-->