Home All Groups Group Topic Archive Search About
Author
1 May 2006 2:58 PM
Tlink
I have have lifted some code that I am trying to make work in 2 seperate
projects it appears to send okay but the it only recieves once then it stop
recieving I am unsure as to why ?

******** sending ****
Private Sub SendAction(ByVal DoAction, ByVal RemoteAddress)
Dim Actionport As Integer = 40000
Dim TCPClient As New TcpClient(RemoteAddress, Actionport)
Dim TCPNetworkStream As NetworkStream = TCPClient.GetStream
Dim TCPStreamWriter As New StreamWriter(TCPNetworkStream)
Try
TCPStreamWriter.Write(DoAction)
Catch ex As Exception
ErrorCondition = ex.Message
End Try
TCPStreamWriter.Close()
TCPNetworkStream.Close()
TCPClient.Close()
End Sub



****** recieving *****

        Dim localhostaddress As IPAddress = MSearchObj.ActiveIP

        Dim Lport As Integer = 40000
        Dim TcpListener As New TcpListener(localhostaddress, Lport)
        TcpListener.Start()

        Dim TCPClient As TcpClient = TcpListener.AcceptTcpClient()
        Dim TCPNetworkStream As NetworkStream = TCPClient.GetStream
        Dim TCPStreamReader As New StreamReader(TCPNetworkStream)

        errorcondition = ""
       Do While errorcondition.Length = 0

            RecievedData = ""
            SendData = ""

            If TcpListener.Pending = False Then
                Thread.Sleep(100)
            Else
                Do While TCPStreamReader.EndOfStream = False
                    RecievedData = TCPStreamReader.ReadLine
                    If RecievedData <> "" Then
                        ProcessInput(RecievedData, SendData, MSearchObj,
DBobj)
                    End If
                Loop
                Thread.Sleep(1000)
            End If
        Loop

Author
1 May 2006 3:24 PM
vbnetdev
Try not using the close statements at the end. You are disconnecting
yourself with these statements.

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com



Show quoteHide quote
"Tlink" <Tlink@online.nospam> wrote in message
news:eUJZD$SbGHA.4972@TK2MSFTNGP03.phx.gbl...
>I have have lifted some code that I am trying to make work in 2 seperate
>projects it appears to send okay but the it only recieves once then it stop
>recieving I am unsure as to why ?
>
> ******** sending ****
> Private Sub SendAction(ByVal DoAction, ByVal RemoteAddress)
> Dim Actionport As Integer = 40000
> Dim TCPClient As New TcpClient(RemoteAddress, Actionport)
> Dim TCPNetworkStream As NetworkStream = TCPClient.GetStream
> Dim TCPStreamWriter As New StreamWriter(TCPNetworkStream)
> Try
> TCPStreamWriter.Write(DoAction)
> Catch ex As Exception
> ErrorCondition = ex.Message
> End Try
> TCPStreamWriter.Close()
> TCPNetworkStream.Close()
> TCPClient.Close()
> End Sub
>
>
>
> ****** recieving *****
>
>        Dim localhostaddress As IPAddress = MSearchObj.ActiveIP
>
>        Dim Lport As Integer = 40000
>        Dim TcpListener As New TcpListener(localhostaddress, Lport)
>        TcpListener.Start()
>
>        Dim TCPClient As TcpClient = TcpListener.AcceptTcpClient()
>        Dim TCPNetworkStream As NetworkStream = TCPClient.GetStream
>        Dim TCPStreamReader As New StreamReader(TCPNetworkStream)
>
>        errorcondition = ""
>       Do While errorcondition.Length = 0
>
>            RecievedData = ""
>            SendData = ""
>
>            If TcpListener.Pending = False Then
>                Thread.Sleep(100)
>            Else
>                Do While TCPStreamReader.EndOfStream = False
>                    RecievedData = TCPStreamReader.ReadLine
>                    If RecievedData <> "" Then
>                        ProcessInput(RecievedData, SendData, MSearchObj,
> DBobj)
>                    End If
>                Loop
>                Thread.Sleep(1000)
>            End If
>        Loop
>
>
>
>
Author
1 May 2006 4:43 PM
Tlink
This did not help in any way it still continues behaves in the same manner.

Show quoteHide quote
"vbnetdev" <vbnetdev@community.nospam> wrote in message
news:ujcxpNTbGHA.4060@TK2MSFTNGP02.phx.gbl...
> Try not using the close statements at the end. You are disconnecting
> yourself with these statements.
>
> --
> Get a powerful web, database, application, and email hosting with KJM
> Solutions
> http://www.kjmsolutions.com
>
>
>
> "Tlink" <Tlink@online.nospam> wrote in message
> news:eUJZD$SbGHA.4972@TK2MSFTNGP03.phx.gbl...
>>I have have lifted some code that I am trying to make work in 2 seperate
>>projects it appears to send okay but the it only recieves once then it
>>stop recieving I am unsure as to why ?
>>
>> ******** sending ****
>> Private Sub SendAction(ByVal DoAction, ByVal RemoteAddress)
>> Dim Actionport As Integer = 40000
>> Dim TCPClient As New TcpClient(RemoteAddress, Actionport)
>> Dim TCPNetworkStream As NetworkStream = TCPClient.GetStream
>> Dim TCPStreamWriter As New StreamWriter(TCPNetworkStream)
>> Try
>> TCPStreamWriter.Write(DoAction)
>> Catch ex As Exception
>> ErrorCondition = ex.Message
>> End Try
>> TCPStreamWriter.Close()
>> TCPNetworkStream.Close()
>> TCPClient.Close()
>> End Sub
>>
>>
>>
>> ****** recieving *****
>>
>>        Dim localhostaddress As IPAddress = MSearchObj.ActiveIP
>>
>>        Dim Lport As Integer = 40000
>>        Dim TcpListener As New TcpListener(localhostaddress, Lport)
>>        TcpListener.Start()
>>
>>        Dim TCPClient As TcpClient = TcpListener.AcceptTcpClient()
>>        Dim TCPNetworkStream As NetworkStream = TCPClient.GetStream
>>        Dim TCPStreamReader As New StreamReader(TCPNetworkStream)
>>
>>        errorcondition = ""
>>       Do While errorcondition.Length = 0
>>
>>            RecievedData = ""
>>            SendData = ""
>>
>>            If TcpListener.Pending = False Then
>>                Thread.Sleep(100)
>>            Else
>>                Do While TCPStreamReader.EndOfStream = False
>>                    RecievedData = TCPStreamReader.ReadLine
>>                    If RecievedData <> "" Then
>>                        ProcessInput(RecievedData, SendData, MSearchObj,
>> DBobj)
>>                    End If
>>                Loop
>>                Thread.Sleep(1000)
>>            End If
>>        Loop
>>
>>
>>
>>
>
>
Author
1 May 2006 5:25 PM
vbnetdev
Hi,

Send zipped project to

admin@nospamkjmsolutions.com

remove no spam and let me see what I can do.

Kelly

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com



Show quoteHide quote
"Tlink" <Tlink@online.nospam> wrote in message
news:uPPWz5TbGHA.504@TK2MSFTNGP03.phx.gbl...
> This did not help in any way it still continues behaves in the same
> manner.
>
> "vbnetdev" <vbnetdev@community.nospam> wrote in message
> news:ujcxpNTbGHA.4060@TK2MSFTNGP02.phx.gbl...
>> Try not using the close statements at the end. You are disconnecting
>> yourself with these statements.
>>
>> --
>> Get a powerful web, database, application, and email hosting with KJM
>> Solutions
>> http://www.kjmsolutions.com
>>
>>
>>
>> "Tlink" <Tlink@online.nospam> wrote in message
>> news:eUJZD$SbGHA.4972@TK2MSFTNGP03.phx.gbl...
>>>I have have lifted some code that I am trying to make work in 2 seperate
>>>projects it appears to send okay but the it only recieves once then it
>>>stop recieving I am unsure as to why ?
>>>
>>> ******** sending ****
>>> Private Sub SendAction(ByVal DoAction, ByVal RemoteAddress)
>>> Dim Actionport As Integer = 40000
>>> Dim TCPClient As New TcpClient(RemoteAddress, Actionport)
>>> Dim TCPNetworkStream As NetworkStream = TCPClient.GetStream
>>> Dim TCPStreamWriter As New StreamWriter(TCPNetworkStream)
>>> Try
>>> TCPStreamWriter.Write(DoAction)
>>> Catch ex As Exception
>>> ErrorCondition = ex.Message
>>> End Try
>>> TCPStreamWriter.Close()
>>> TCPNetworkStream.Close()
>>> TCPClient.Close()
>>> End Sub
>>>
>>>
>>>
>>> ****** recieving *****
>>>
>>>        Dim localhostaddress As IPAddress = MSearchObj.ActiveIP
>>>
>>>        Dim Lport As Integer = 40000
>>>        Dim TcpListener As New TcpListener(localhostaddress, Lport)
>>>        TcpListener.Start()
>>>
>>>        Dim TCPClient As TcpClient = TcpListener.AcceptTcpClient()
>>>        Dim TCPNetworkStream As NetworkStream = TCPClient.GetStream
>>>        Dim TCPStreamReader As New StreamReader(TCPNetworkStream)
>>>
>>>        errorcondition = ""
>>>       Do While errorcondition.Length = 0
>>>
>>>            RecievedData = ""
>>>            SendData = ""
>>>
>>>            If TcpListener.Pending = False Then
>>>                Thread.Sleep(100)
>>>            Else
>>>                Do While TCPStreamReader.EndOfStream = False
>>>                    RecievedData = TCPStreamReader.ReadLine
>>>                    If RecievedData <> "" Then
>>>                        ProcessInput(RecievedData, SendData, MSearchObj,
>>> DBobj)
>>>                    End If
>>>                Loop
>>>                Thread.Sleep(1000)
>>>            End If
>>>        Loop
>>>
>>>
>>>
>>>
>>
>>
>
>
Author
2 May 2006 1:34 AM
Tlink
Kelly,

    worked it out, the solution is to the place all the processing items
within the do while loop this ensures that the active listener is active and
ready.

Show quoteHide quote
"vbnetdev" <vbnetdev@community.nospam> wrote in message
news:ejJ8FRUbGHA.5000@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> Send zipped project to
>
> admin@nospamkjmsolutions.com
>
> remove no spam and let me see what I can do.
>
> Kelly
>
> --
> Get a powerful web, database, application, and email hosting with KJM
> Solutions
> http://www.kjmsolutions.com
>
>
>
> "Tlink" <Tlink@online.nospam> wrote in message
> news:uPPWz5TbGHA.504@TK2MSFTNGP03.phx.gbl...
>> This did not help in any way it still continues behaves in the same
>> manner.
>>
>> "vbnetdev" <vbnetdev@community.nospam> wrote in message
>> news:ujcxpNTbGHA.4060@TK2MSFTNGP02.phx.gbl...
>>> Try not using the close statements at the end. You are disconnecting
>>> yourself with these statements.
>>>
>>> --
>>> Get a powerful web, database, application, and email hosting with KJM
>>> Solutions
>>> http://www.kjmsolutions.com
>>>
>>>
>>>
>>> "Tlink" <Tlink@online.nospam> wrote in message
>>> news:eUJZD$SbGHA.4972@TK2MSFTNGP03.phx.gbl...
>>>>I have have lifted some code that I am trying to make work in 2 seperate
>>>>projects it appears to send okay but the it only recieves once then it
>>>>stop recieving I am unsure as to why ?
>>>>
>>>> ******** sending ****
>>>> Private Sub SendAction(ByVal DoAction, ByVal RemoteAddress)
>>>> Dim Actionport As Integer = 40000
>>>> Dim TCPClient As New TcpClient(RemoteAddress, Actionport)
>>>> Dim TCPNetworkStream As NetworkStream = TCPClient.GetStream
>>>> Dim TCPStreamWriter As New StreamWriter(TCPNetworkStream)
>>>> Try
>>>> TCPStreamWriter.Write(DoAction)
>>>> Catch ex As Exception
>>>> ErrorCondition = ex.Message
>>>> End Try
>>>> TCPStreamWriter.Close()
>>>> TCPNetworkStream.Close()
>>>> TCPClient.Close()
>>>> End Sub
>>>>
>>>>
>>>>
>>>> ****** recieving *****
>>>>
>>>>        Dim localhostaddress As IPAddress = MSearchObj.ActiveIP
>>>>
>>>>        Dim Lport As Integer = 40000
>>>>        Dim TcpListener As New TcpListener(localhostaddress, Lport)
>>>>        TcpListener.Start()
>>>>
>>>>        Dim TCPClient As TcpClient = TcpListener.AcceptTcpClient()
>>>>        Dim TCPNetworkStream As NetworkStream = TCPClient.GetStream
>>>>        Dim TCPStreamReader As New StreamReader(TCPNetworkStream)
>>>>
>>>>        errorcondition = ""
>>>>       Do While errorcondition.Length = 0
>>>>
>>>>            RecievedData = ""
>>>>            SendData = ""
>>>>
>>>>            If TcpListener.Pending = False Then
>>>>                Thread.Sleep(100)
>>>>            Else
>>>>                Do While TCPStreamReader.EndOfStream = False
>>>>                    RecievedData = TCPStreamReader.ReadLine
>>>>                    If RecievedData <> "" Then
>>>>                        ProcessInput(RecievedData, SendData, MSearchObj,
>>>> DBobj)
>>>>                    End If
>>>>                Loop
>>>>                Thread.Sleep(1000)
>>>>            End If
>>>>        Loop
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>