how to disconnect tcp/ip connection?

117 views (last 30 days)
I made tcp/ip server and client like this
server = tcpserver('',111);
and another app
cli = tcpclient('localhost',111);
It is perfectly connected.
So, how to disconnect TCP/IP form client?
and how to disconnect from server?

Accepted Answer

Harikrishnan Balachandran Nair
You can close the TCP/IP connection by clearing the 'tcpclient' object using the 'clear' function .
Please refer to the following documentations to get a better idea on this :
Hope this helps!
Jae-Hee Park
Jae-Hee Park on 30 Dec 2021
@chuck shen Thank you.
Above command works clear the values of app.client but do not erase the app.client.
isa(app.client,'tcpclient'); % is true
There is no way to completely erase the app.client?

Sign in to comment.

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!