Ok so subject says it all...
When I write a byte to the tcpserver, the console will print it out, but if there is any text after the returned byte, it scrolls down, also even if there is no string after it.
SERVER:
CLIENT:
I've always used this same code and it's never scrolled all the way down like this before.. any help?
When I write a byte to the tcpserver, the console will print it out, but if there is any text after the returned byte, it scrolls down, also even if there is no string after it.
SERVER:
VB.NET:
Imports System.Net.Sockets
Imports System.Text
Module Module1
Dim server As TcpListener
Dim client As TcpClient
Sub Main()
server = New TcpListener(8000)
server.Start()
Console.WriteLine("Waiting...")
While True
client = server.AcceptTcpClient
Dim networkStream As NetworkStream = client.GetStream()
Dim bytes(client.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0, CInt(client.ReceiveBufferSize))
Dim clientdata As String = Encoding.ASCII.GetString(bytes)
Console.WriteLine(("Client sent: " + clientdata))
End While
End Sub
End Module
CLIENT:
VB.NET:
Imports System.Net.Sockets
Imports System.Text
Public Class Form1
Dim tcpClient As New System.Net.Sockets.TcpClient()
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
tcpClient.Connect("127.0.0.1", 8000)
Dim networkStream As NetworkStream = tcpClient.GetStream()
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes("Is anybody there")
networkStream.Write(sendBytes, 0, sendBytes.Length)
End Sub
End Class
I've always used this same code and it's never scrolled all the way down like this before.. any help?