mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
made ports reusable and added cannot connect to these ports in error class
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@453 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -189,6 +189,15 @@ protocol(p), is_a_server(0), socketDescriptor(-1),file_des(-1), packet_size(ps),
|
||||
}
|
||||
|
||||
|
||||
// reuse port
|
||||
int yes=1;
|
||||
if (setsockopt(socketDescriptor,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(int)) == -1) {
|
||||
cerr << "setsockopt" << endl;
|
||||
socketDescriptor=-1;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(bind(socketDescriptor,(struct sockaddr *) &serverAddress,sizeof(serverAddress))<0){
|
||||
cerr << "Can not bind socket "<< endl;
|
||||
socketDescriptor=-1;
|
||||
|
Reference in New Issue
Block a user