Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
How can I close a tcp/ip socket without killing the owning process? | How can I close a tcp/ip socket without killing the owning process? – Dr Adam Stanton About Blog Published Work Projects Dr Adam Stanton Adaptive Informatician How can I close a tcp/ip socket without killing the owning process? 2016-05-16 by adamst Problem: a program has a socket open and you want to force it to close without killing the owning process. Solution: get the file descriptor of the socket, debug the process and manually call close on the file descriptor. On Linux systems: Find the offending process: netstat -np Find the socket file descriptor: lsof -np $PID Debug the process: gdb -p $PID Close the socket: call close($FD) Close the debugger: quit Profit. From here. On OSX the incantations are differently formed: Find the offending process and file descriptor: lsof -ni TCP Debug the process: lldb -p $PID Close the socket: call (int)close($FD) Close the debugger: quit Profit. Categories: Uncategorized | Permalink Comments are closed. ← Previous Post Next Post → Recent Posts Can I listen to your RI panel discussion? How to use gscript to choose a random file from a Google Drive folder, and open it? What’s the Royal Institution like? What does it mean to discover numbers? Is there a vibrant tech community in Stoke? Proudly powered by WordPress | Theme: Yoko by Elmastudio Top