Hi,
Seems another day another challenge.
I am trying to send ascii strings to a network device. All is good when I send the first command, the device receives it, but when I go to send the next command I am told the socket is not connected so I am at the moment cheating by calling a sub called connecttonuvo again to force a reconnection.
Here is my code snippit
Sub Socket1_Connected (Successful As Boolean)
If Successful = False Then
Connecttonuvo
End If
Try
tw.Initialize(Socket1.OutputStream)
tw.Write(SendString&Chr(13))
tw.close
Log("Data Sent - "&SendString)
Return
Catch
'putting this in here to suppress any errors
' nope
End Try
end sub
I put in a try and catch to stop the error about the socket not being open from being displayed.
any pointers would be great.
I have tried using tw.writeline too but its the same,
I think the tw.close is closing the socket too, is this the case? and is there another way of writing to a socket which and keeping the socket alive so the next command can be sent straight away?
the command I am sending includes CHR(13) which is how my networked device knows to action the command it has received.
thanks in advance
Darren
Seems another day another challenge.
I am trying to send ascii strings to a network device. All is good when I send the first command, the device receives it, but when I go to send the next command I am told the socket is not connected so I am at the moment cheating by calling a sub called connecttonuvo again to force a reconnection.
Here is my code snippit
Sub Socket1_Connected (Successful As Boolean)
If Successful = False Then
Connecttonuvo
End If
Try
tw.Initialize(Socket1.OutputStream)
tw.Write(SendString&Chr(13))
tw.close
Log("Data Sent - "&SendString)
Return
Catch
'putting this in here to suppress any errors
' nope
End Try
end sub
I put in a try and catch to stop the error about the socket not being open from being displayed.
any pointers would be great.
I have tried using tw.writeline too but its the same,
I think the tw.close is closing the socket too, is this the case? and is there another way of writing to a socket which and keeping the socket alive so the next command can be sent straight away?
the command I am sending includes CHR(13) which is how my networked device knows to action the command it has received.
thanks in advance
Darren