Clear buffers for communication using TCP/IP server
Flush TCP/IP Server Inputs and Outputs
Create a TCP/IP server on port 4000.
server = tcpserver(4000)
server = TCPServer with properties: ServerAddress: "::" ServerPort: 4000 Connected: 0 ClientAddress: "" ClientPort:  NumBytesAvailable: 0 Show all properties, functions
Create a TCP/IP client to connect to your server object using
tcpclient. You must specify the same port number you use to create
client = tcpclient("localhost",4000);
Write some data to the client and view the number of bytes available to be read in the server input buffer.
ans = 5
Flush both the input and output buffers of the server.
View the number of bytes available to be read.
ans = 0
The input buffer has no data.