Using A Central Startup Routine To Initiate Several TCP Connections?

Jan 6, 2011

I'm using a central startup routine to initiate several TCP connections, start up a background thread that does some monitoring, and instantiate a group of objects that track information throughout the lifetime of a networking session.

There are periodically server-side problems with the protocol I'm working with, at which point the whole mess has to be torn down and set back up, so at the front end of the startup routine I'm disposing of instantiated tracking objects, killing the monitoring thread, and disconnect/close the existing sockets (if they're already set up). At that point the sockets may be in the middle of an asynchronous send or receive operation, which is causing system exceptions when the socket is torn down and then the asynchronous delegate gets called and EndSend or EndReceive thinks there isn't an object there anymore.

I had assumed .Disconnect and .Close would take care of these async processes, and I'm a little lost. Is there some one-shot method I can use to abort those async operations before I tear the sockets down to re-instantiate them?It never hurts to try. In a worst case scenario, you'll learn from it.

View 10 Replies


ADVERTISEMENT

Fire The Timer Or Other Routine While Still The WHILE TRUE Routine Checks For Incoming Connections And Messages?

Jan 24, 2012

I am using sockets to send message between computers. I send the messages alright. What I want is when the message "x0x" comes, the client must be closed within 5 minutes. Teh admin can cancel the request by sending message "-xx" as well. The routine that checks for incoming connections and accepts messages uses WHILE TRUE...END WHILE since it must always listen. Once I get a message, I need to fire a timer control or other that fires within 5 minutes. But the program cant leave the WHILE TRUE at all. If i exit it early, the timer fires and the program does get exit. How do I fire the timer or other routine while still the WHILE TRUE routine checks for incomin connections and messages?

View 5 Replies

Error On Global.asa - Central Place To Put Routine - Instead To Copy It Into Every .vb File That Belongs To Each .apsx Code File

Jun 2, 2012

I am wondering if Global.asa can handle a procedure like this:

Protected Sub errore(tipo As Int16)
'Response.Write(Err.Description) 'or your own custom error message
Dim msg As String

[CODE]...

The idea is to have a central place to put the routine in instead to copy it into every .vb file that belongs to each .apsx code file.

View 4 Replies

Reference A Particular Code Routine In .net External To The Current Loop/routine?

Apr 17, 2011

is there any way to reference a particular code routine in VB.net external to the current loop/routine?Example:

If Var01 < 5
[Routine A]
Else
[Routine B]
End If

where Routine A and Routine B are code sequences at the end of the entire program -- such as outside of the current sub or class? The idea would be to reference an otherwise repetitive code.

View 4 Replies

.Net SQLClient Connections And SQL Server - Active Connections Reflect Even Though All Closed?

Jul 19, 2011

Using VB.Net and SQL Server 2008 R2: I have recently had a database that using sp_who2 reflects a connection ".Net SqlClient Data Provider" is still active even though the .Net application has closed and disposed of all connections.

[Code]...

View 1 Replies

Asp.net - Share A Variable From Sub Routine To Sub Routine?

Mar 3, 2009

I have a sub routine where I pull in information from a database. I want to use variables from this sub routine in another sub routine. I tried making everything public but it doesn't want to be friendly and share.

Dim strEmail as String
Public Sub readDB()
strEmail = "whatever@doohikcy.com"

[Code]....

The readDB would read the database and set the variables and do whatever it needs to do. Then when they submit the form it would e-mail the form to whatever the email address was.

View 2 Replies

Initiate X Amount Of A Variable?

Dec 8, 2010

Okay so maybe i'm looking at this problem the wrong way and if I am please tell me but here goes.

View 3 Replies

Initiate A Stored Procedure In Function?

May 24, 2012

This code updates the fiscal year automatically.[code]...

View 1 Replies

Initiate Array On Existing Object?

Aug 30, 2011

I have just started to work with Webservices and the vendor have provided me with a wsdl reference file.I have added the file to my project.The examples the vendor provide is written in C# (which I wish I was programming in) but I'm a old school VB programmer so I'm trying to map it over. In the examples they seem to initate a new array in an existing object but I can't figure out how to do this in VB?The example shows the following (C#)

Security_Authenticate sec_auth = new Security_Authenticate();
sec_auth.dutyCode = new Security_AuthenticateDutyCode();
sec_auth.dutyCode.dutyCodeDetails = new Security_AuthenticateDutyCodeDutyCodeDetails();

[code]....

View 10 Replies

Initiate Internet Data Connection On WM6 Devices?

Jun 22, 2010

I am currently porting (well really totally re-writing) a project to run on WM6 devices. I need to initiate a GPRS data connection (or any internet data connection really, shouldn't matter if its GSM or CDMA) before I can get the data I need (actually sync. a database over the cell network - Sybase via Mobilink) because right now its basically saying I have no network connection when I make the call to sync the db.

If I open Internet Explorer on the device, it initiates the data connection, and I can then go back into my program and get the data no problem. This isn't an acceptable solution however.

How can I initiate the internet data connection?

View 3 Replies

Multiple Apps With Central Database

May 8, 2009

I have an application which writes to and reads from a database. I'd like to be able to have the application installed on a number of computers with the database installed on a central server which all of the applications will connect to.

first of all, installation (installing the app is simple, but how can I get an install program to put the database on the server?), and next, concurrency errors?

I understand that having more than one person trying to update the database at the same time is likely to cause concurrency errors, but short of deploying my application and having everyone try to write to the database at once, I'm not sure how to approach this.

View 8 Replies

Run On Client Machines From Central Server

Jun 11, 2011

I have created an application using ODBC data sources.it runs on a local machine well. but i want it to run on client machines from central server. the following is the code that i use:[code]where cleaners is a data source i have manually created in ODBC data sources.and then uses the connection for inserting,deleting and so on.can somebody help me with a code that can enable it access the remote machine.

View 1 Replies

.net - Initiate The Current Httpcontext When Accessing An Asp.net Library From A Service?

Jul 27, 2011

I have an asp.net project that's compiled on a server. On that same server I have a windows service that's running methods referenced from the asp.net .dll. Everything works fine except for when the httpcontext.current object needs to be accessed. I'm fairly certain that the cause of the .current being null is that it's referencing the shared library without an actual instance of the site running. In a previous version of the service I was able to find a workaround in asp.net by not using the context, however that is now a last resort as much of the architecture of the site has changed. Is there anyway to create an instance of the site and simulate a current httpcontext for the purposes of the service?

View 2 Replies

Grand Central Dispatch For Visual Basic?

May 28, 2011

In Mac OS X I can take advantage of more than 1 core using GCD (Grand Central Dispatch). What is the equivalent for a Visual Basic program?

View 2 Replies

VS 2008 - Central Game Server / Clients

Jun 25, 2010

I've got a game I would like to build, it will require a central game server where peoples data (game data :-)) will be sent to and shared with other players - how is the done. Is it remoting? TCP? something else - I need to study up on it but want to make sure I'm learning the right thing.

View 3 Replies

Hide Form On Startup If App Occurred Because Of Windows Startup?

Jun 20, 2010

I can hide my startup form (or make it appear hidden) on startup. I can start my app on windows startup--through registry values--if the user checks a checkbox.

But if the app starts up on windows startup, I want the form to be hidden, so the program can just keep working without bothering anyone. If it starts up because the user started it, I want the form to be showing, because the user probably wants to change some settings or something.

View 8 Replies

.net - Keep A Class In A Central Location And Reference It From Multiple Websites?

Aug 19, 2009

We have several VB.NET websites running internal applications. These sites are often modified with minor changes, and are maintained on the server as uncompiled code. I'm looking for the best way to maintain classes so that we can reference them from multiple websites.

Specifically, we're looking to put some common functions (error logging, common database calls, etc.) into a centralized location where they can be maintained separately from the sites and called as needed. And we'd prefer to have this on the server as uncompiled code, so it can be uploaded without precompiling. I feel like I'm missing something obvious, but what is the best way to set this up?

View 3 Replies

Build A Menu From Multiple Xml Files In A Central Location?

Nov 1, 2011

I am wanting to build a menu from multiple xml files in a central location this will be to help with adding crystal reports after application has been deployed to an end user.I am able to get the list of all the xml files in a folder it is just the adding the ReportName to the different menu buttons i have set up.

Dim dirs As String() = Directory.GetFiles(Application.StartupPath & "Reports", "*.xml")
Dim dir As String For Each dir In dirs Dim xe As XElement = XElement.Load(dir)Next

View 9 Replies

Store In A Central Place Where The Numbers And The Message Will Be Stored?

Jan 22, 2010

I need some help with to make a messages system. I build a form with display a message code and the message.

Example : 0000001 : Not connected to network

The problem is that i want to store in a central place where the numbers and the message will be stored in the code. I was thinking about a array to store the date.

View 3 Replies

VS 2008 App For Sync Files On Client With Central Computer (VPN)

Jun 22, 2009

This is the situation: i have the central location with the main computer,and 14 distanced locations connected in VPN and often we need to update program manually (on distanced locations) by overwriting the existing .dll-s of the program and this is pain in the ass to connect remotely to 14 locations and on each workstation overwrite the .dll files so i want to create application which is going to be installed on each WS and by running this app it will check the program folder on central computer and if there is any file with newer version then existing one on the WS it will copy it from central computer and overwrite the old file/s on WS. It is a small app with two buttons and progress bar but the main thing is the Update now button because i dont�t know which commands it should commit.

View 22 Replies

Initiate Copy Command On Multiple Files And Add The File Paths To Listbox?

Jan 19, 2011

I created a Right-Click Menu option for files. When the user clicks the menu option it will copy all of the file paths to the clipboard.The following function I have will retrieve all of the filepaths to the clipboard. The problem lies in adding the filepaths to the listbox. If I turn single instance application off the result is multiple instance of the application for each filepath. Say for example I selected 2 files and clicked my right-click menu, I wind up with 2 instance of my exe with each file path added to the listbox, 1 in one listbox, the other file path in the second instance listbox.

Public Sub getthepath()
Try
Dim thefilepath As String

[code]....

Is there a way to loop through each file path from the clipboard and add them to the listbox through a loop?Several times I have tried different ideas I had that I thought would do it and I got odd results but never a good result.

View 4 Replies

Adding A Data From More Than 1 Computer To A Database That Is Locate On Central Server

Jan 1, 2011

My application is in VS 2008 (vb.net Windows form)

I want tips for this:

What types of care I take for it?

What types of problems can be generally happen?

View 1 Replies

Make An Application To Startup At The System Startup?

Mar 4, 2010

How to make an Application to startup at the system startup? and How to enable and disable?

View 6 Replies

Application Not Starting Wit New Startup Form After Deleted The Previous Startup Form?

Nov 11, 2009

i deleted my previous start up form to be replaced by another one but each time i launch the application,the deleted start up form is still displayed.i dont know from where this deleted start up form is being loaded.

View 3 Replies

Call A Function / String That It Uses Will Be Given To Function To Initiate A Download?

Aug 21, 2009

Some programs implement command parameters, Like my favourite computer game - Crysis - has them and windows media player has them.But how could i implement them in VB.NET..I want to have a component of my program built as a seperate exe - so it can be an Optional component.But of course the seperate exe, on load, needs data passing to it.So i need something like Process.start("Componentname.exe", "/StartDL <Suchandsuchastring>)/StartDL will need to call a function, and the string that it uses will be given to the function to initiate a download?

View 9 Replies

Add Progress Bar To This Routine?

Jul 30, 2009

What would be the best way to add a progress bar to this routine so that it corresponds with the progress bar?[code...]

View 6 Replies

Have To Hit Tab Key Twice To Fire Routine In Dgv

Jun 22, 2010

When entering a value in dgv I want the Tab key to fire a routine. Works out ok only thing is I have to hit the Tab twice before it fires. Don't know why, is there a way to prevent it, so that I have to hit the Tab key only once ?

View 1 Replies

Sub Routine Not Executing?

Feb 4, 2011

I have the following code:

Code:
Imports System.Data.SqlClient
Imports System.Data
Public Class Main[code]...

and the sub Exceptionquery is not working. I can verify this because it is supposed to create a new table called scratchpad3. what I may be missing in that sub routine that isn't allowing it to work?

View 8 Replies

Using The SendKeys Routine?

May 28, 2009

I was looking for something send keystrokes and I found this helpful routine SendKeys that I can use in a VB Script. I wanted to have "Right Control Key + (Scroll Lock & Scroll Lock)" sent to the machine. Essentially, having the Right Control Key pressed, I need Scroll Lock pressed twice. Here is what I tried:

set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys"^({SCROLLLOCK}{SCROLLLOCK})"

View 3 Replies

Why Is Sub Routine Not Firing

Feb 4, 2011

I have the following code:

Private Sub Exceptionquery()
Dim connection As System.Data.SqlClient.SqlConnection
Dim connectionString As String = "Initial Catalog=mdr;Data Source=xxxxx;uid=xxxxx;password=xxxxx"

[code]....

I get the error Invalid Object name 'Scratchpad3' on this line:

adapter.Fill(ds)

I have tried to debug this and can see that the query is correct, that the values that are being passed to the sql server are correct but it doesnt look like my code is firing off the Exceptionquery Sub. I thought to call a sub all you had to enter was the name of the sub such as this line:

Exceptionquery()

I have also verified that the mapping of the buttonclick event is mapped correctly. I have other subs that I am calling in almost the same way and those work.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved