Manually closing a port from commandline
Problem
I want to close an open port which is in listening mode between my client and server application. Is there any manual command line option in Linux to close a port? NOTE: I came to know that "only the application which owns the connected socket should close it, which will happen when the application terminates." I don't understand why it is only possible by the application which opens it ... But I'm still eager to know if there is any other way to do it.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix for: Manually closing a port from commandline
I had same problem, the process must keep alive but the socket must close. Closing a socket in a running process is not impossible but difficult: locate the process : You get a map locate the the socket's file descriptor in the process You get a list: process name, pid, user,fileDescriptor, ... a connection string. Locate the matching fileDescriptor number for the connection. It'll be something like "97u" which means "97". Now connect the process: Now close the socket: example: Then detach gdb:…
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix