|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
TCP send & Recieveprojects 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 Try not using the close statements at the end. You are disconnecting
yourself with these statements. -- Show quoteHide quoteGet 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 > > > > 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 >> >> >> >> > > Hi,
Send zipped project to admin@nospamkjmsolutions.com remove no spam and let me see what I can do. Kelly -- Show quoteHide quoteGet 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 >>> >>> >>> >>> >> >> > > 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 >>>> >>>> >>>> >>>> >>> >>> >> >> > >
hierachical related data in datatset
VB2005 Pro Edition--Data Sources window is disabled when viewing forms Binding to an enumeration Multithreading Problem web reference to system.web.dll Converting VB Script Code to VB.NET 2005 Traversing a Collection evaluate or transform or ??? SelectionChangeCommitted event How to display Printer Settings Dialogue? |
|||||||||||||||||||||||