Application.Lock() from whitin custom class

P

P. Prosper

I need some help on this issue. I am trying to lock the application object
from within a vb class but I'll get the following error:

Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.

Source Error:

Line 84: Dim i As Integer
Line 85: Dim TmpSockets(5) As String
Line 86: application.Lock()
Line 87: TmpSockets = application("sockets")
Line 88: For i = 1 To 5

Source File: C:\Inetpub\wwwroot\webapp\TCPPipe.vb Line: 86

In the declarations of my class I have:
Public Class TCPPipe

Inherits System.Web.HttpApplication

Any help / suggestion will be greatly appreciated.

PS : I'm using VS.NET 2003
 
P

P. Prosper

I finally solved the issue. In the class I inserted
Dim AppState As HttpApplicationState = HttpContext.Current.Application

then used AppSate.Lock()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top