Amit, I cannot test it right now, but I suspect you are correct. As I recall, I simply copied a snippet of code from another application for the socket initialization.
I can probably test and commit it this weekend if no one else gets to it first. Regards, Eric I have had emcrsh hangup on exit i.e., the socket does not close and the TCP connection goes into TIME_WAIT (tested with command "netstat -ta" after exit). I propose we can use re-usable sockets by using the setsockopt function as: File: /emc/user_intf/emcrsh.cc Line: 549 Function: initSockets() Change: server_sockfd=socket(AF_INET,SOCK_STREAM,0); int optval = 1; setsockopt(server_sockfd, SOL_SOCKET, SO_REUSEADDR, &optval,sizeof(optval)); server_address.sin_family = AF_INET; I have used this technique successfully in the past with many re-usable sockets quite successfully. This will ensure clean exit/immediate restart of emcrsh program. Can anyone please comment on this change? ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
