Click here to Skip to main content
15,912,329 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionvb.net to Access Pin
anne lewis3-Oct-06 4:13
anne lewis3-Oct-06 4:13 
QuestionMulti level context menu Pin
dAb73-Oct-06 2:55
dAb73-Oct-06 2:55 
AnswerRe: Multi level context menu Pin
UltraCoder9-Oct-06 17:21
UltraCoder9-Oct-06 17:21 
Questiontextbox in class Pin
nbulut3-Oct-06 1:54
nbulut3-Oct-06 1:54 
AnswerRe: textbox in class Pin
Dave Kreskowiak3-Oct-06 2:13
mveDave Kreskowiak3-Oct-06 2:13 
QuestionVb6 to Vb 2005 Pin
prashweenet3-Oct-06 1:37
prashweenet3-Oct-06 1:37 
AnswerRe: Vb6 to Vb 2005 [modified] Pin
Dave Kreskowiak3-Oct-06 2:09
mveDave Kreskowiak3-Oct-06 2:09 
QuestionBizarre Winsock behaviour in VB 6.0 Pin
Nic Rowan3-Oct-06 0:46
Nic Rowan3-Oct-06 0:46 
I have an old VB6 legacy app that I'm maintaining at a client. Basically a client app connects to a server app and then receives data. The client connects when the app is loaded and stays connected until the program closes.

I have to add some code to this app that will get the client app to reconnect to the server app if the connection is broken. If the connection is broken, or if it fails to connect, I start a timer that tries to connect every minute or so.

Here's the problem. When I connect on Page Load it connects fine. If the inital connect does'nt work and I try connect later on with the timer the connection gets stuck in state 6 (which is connecting) and it never actually connects.

Here's the code I use to connect on both page load and in the timer:
Private Sub ConnectToEventPub()

    wsReader.remotehost = strRemoteHost
    wsReader.RemotePort = 100
    wsReader.Connect

    While wsReader.State = 3 Or wsReader.State = 4 Or wsReader.State = 5 Or wsReader.State = 6
        DoEvents 'wait for connection to complete
    Wend
    
    If wsReader.State = 7 Then 'if connected send info
        wsReader.SendData (aService & "|" & aAbandonTime)
        bISWinsockConnected = True
        tmrReconnect.Enabled = False
    Else
        bISWinsockConnected = False
        tmrReconnect.Enabled = True
    End If
End Sub


The Sub works fine when called from Page Load but not when called from the timer.

Any ideas? I'm stumped and sitting in a freezing server room.



Capital Punishment means never having to say "you again?"

As easy as 3.141592653589793238462643383279502884197169




Questionsending parameters through asp.net page Pin
ADY0072-Oct-06 23:13
ADY0072-Oct-06 23:13 
AnswerRe: sending parameters through asp.net page Pin
Christian Graus2-Oct-06 23:42
protectorChristian Graus2-Oct-06 23:42 
GeneralRe: sending parameters through asp.net page Pin
ADY0073-Oct-06 0:11
ADY0073-Oct-06 0:11 
GeneralRe: sending parameters through asp.net page Pin
Christian Graus3-Oct-06 0:21
protectorChristian Graus3-Oct-06 0:21 
GeneralRe: sending parameters through asp.net page Pin
Dave Sexton3-Oct-06 0:20
Dave Sexton3-Oct-06 0:20 
QuestionAny good free documentation or podcasts? Pin
Wolf922-Oct-06 21:39
Wolf922-Oct-06 21:39 
QuestionVisual BASIC express and Visual BASIC Pin
Wolf922-Oct-06 21:35
Wolf922-Oct-06 21:35 
AnswerRe: Visual BASIC express and Visual BASIC Pin
CWIZO2-Oct-06 21:37
CWIZO2-Oct-06 21:37 
GeneralRe: Visual BASIC express and Visual BASIC Pin
Wolf922-Oct-06 21:42
Wolf922-Oct-06 21:42 
AnswerRe: Visual BASIC express and Visual BASIC Pin
Christian Graus2-Oct-06 22:15
protectorChristian Graus2-Oct-06 22:15 
GeneralRe: Visual BASIC express and Visual BASIC Pin
Wolf922-Oct-06 23:17
Wolf922-Oct-06 23:17 
GeneralRe: Visual BASIC express and Visual BASIC Pin
Christian Graus2-Oct-06 23:38
protectorChristian Graus2-Oct-06 23:38 
Questionpath Pin
minniemooo2-Oct-06 21:13
minniemooo2-Oct-06 21:13 
AnswerRe: path Pin
Christian Graus2-Oct-06 21:58
protectorChristian Graus2-Oct-06 21:58 
AnswerRe: path Pin
Dave Kreskowiak3-Oct-06 5:56
mveDave Kreskowiak3-Oct-06 5:56 
QuestionASP.NET Web Application Pin
messages2-Oct-06 21:05
messages2-Oct-06 21:05 
AnswerRe: ASP.NET Web Application Pin
Christian Graus2-Oct-06 22:17
protectorChristian Graus2-Oct-06 22:17 

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.