Hi, i am writing an application in java swing which uses socket to connect to python agent, send and receives data over the socket and closes,

now when i try to reopen the socket, it gives me error,

i tried checking socket status after socket is closed, i stuck on following problem

clientSocket is my java socket,

clientSocket.isConnected() returns true
clientSocket.isBound() returs true
clientSocket.isClosed() return true

can anybody help, how can i ensure what is status of my socket?