G
Greg
I've implemented the code from MS at:
http://msdn.microsoft.com/library/d...rlrfSystemNetSocketsTcpListenerClassTopic.asp
and am able to send data but it only works once. Nothing happens the second
time, not even an error.
Here's what my client function looks like:
Function SendData(ByVal Data As String) As String
Dim port As Int32 = 13000
Dim localAddr As IPAddress = IPAddress.Parse("127.0.0.1")
Dim client As New TcpClient
client.Connect(localAddr, port)
Dim stream As NetworkStream = client.GetStream()
Dim msg As [Byte]() = System.Text.Encoding.ASCII.GetBytes(Data)
stream.Write(msg, 0, msg.Length)
client.Close()
End Function
Anyone know what the problem is?
http://msdn.microsoft.com/library/d...rlrfSystemNetSocketsTcpListenerClassTopic.asp
and am able to send data but it only works once. Nothing happens the second
time, not even an error.
Here's what my client function looks like:
Function SendData(ByVal Data As String) As String
Dim port As Int32 = 13000
Dim localAddr As IPAddress = IPAddress.Parse("127.0.0.1")
Dim client As New TcpClient
client.Connect(localAddr, port)
Dim stream As NetworkStream = client.GetStream()
Dim msg As [Byte]() = System.Text.Encoding.ASCII.GetBytes(Data)
stream.Write(msg, 0, msg.Length)
client.Close()
End Function
Anyone know what the problem is?