I am trying to restart the application using code. But when i try to restart it gives me BindException: port already in use. Can i close that port by code and allocate it to another process. Can some one guide me in this?
Asked
Active
Viewed 42 times
0
-
Yes. In the process that opened it. – Elliott Frisch Nov 26 '14 at 20:37
-
Actually i don't have the reference of that process so I can't close it from that project. – Renaissance Nov 26 '14 at 21:00
-
What i want to do is i want to close the socket abruptly using code. – Renaissance Nov 26 '14 at 21:01
-
I don't think so it's the similar problem. In this...i just want to close socket, free the port and reuse it again. – Renaissance Nov 26 '14 at 21:02
-
I don't think you understood my comment; *no* there is no way to close that socket from another process abruptly (or otherwise). – Elliott Frisch Nov 26 '14 at 21:05
-
This is not what you want to do. You want either to stop the other process running ever, or change its port permanently, or change your own port permanently. You don't want to stop arbitrary processes from code. – user207421 Nov 26 '14 at 21:21