source: fact/FADctrl/FADBoard.cc@ 10261

Last change on this file since 10261 was 10261, checked in by ogrimm, 14 years ago
Boards with communication error are set inactive
File size: 18.4 KB
Line 
1/********************************************************************\
2
3 Class interfacing to FAD board
4
5\********************************************************************/
6
7#include "FADBoard.h"
8using namespace std;
9
10//
11// Constructor
12//
13FADBoard::FADBoard(string Server, unsigned short ServerPort, class FAD *Parent, unsigned int Num) {
14
15 int Ret;
16
17 // Initialization
18 m = Parent;
19 Active = false;
20 Continue = true;
21 CommOK = false;
22 ACalib.Time = -1;
23 Status.Update.tv_sec = -1;
24 Port = ServerPort;
25
26 Name = new char [Server.size()+1]; // Name in permanent memory for DIM service
27 strcpy(Name, Server.c_str());
28
29 // Initialise mutex for synchronization
30 pthread_mutexattr_t Attr;
31
32 if ((Ret = pthread_mutexattr_settype(&Attr, PTHREAD_MUTEX_ERRORCHECK)) != 0) {
33 m->Message(m->ERROR, "pthread_mutex_settype() failed (%s)", strerror(Ret));
34 }
35 if ((Ret = pthread_mutex_init(&Mutex, &Attr)) != 0) {
36 m->Message(m->FATAL, "pthread_mutex_init() failed (%s)", strerror(Ret));
37 }
38
39 // Initialise condition variable for synchronization
40 if ((Ret = pthread_cond_init(&CondVar, NULL)) != 0) {
41 m->Message(m->FATAL, "pthread_cond_init() failed (%s)", strerror(Ret));
42 }
43
44 // Construct DIM service name prefix
45 stringstream ID;
46 ID << SERVER_NAME"/Board" << setfill('0') << setw(2) << Num << "/";
47
48 DIM_Name = new DimService((ID.str()+"Server").c_str(), Name);
49 DIM_ID = new DimService((ID.str()+"BoardID").c_str(), (char *) "S", NULL, 0);
50 DIM_Temp = new DimService((ID.str()+"Temperature").c_str(), (char *) "F", NULL, 0);
51 DIM_DAC = new DimService((ID.str()+"DAC").c_str(), (char *) "S", NULL, 0);
52 DIM_ROI = new DimService((ID.str()+"ROI").c_str(), (char *) "S", NULL, 0);
53
54 // Create thread that connects and receives data
55 if ((Ret = pthread_create(&Thread, NULL, (void * (*)(void *)) LaunchThread,(void *) this)) != 0) {
56 m->Message(m->FATAL, "pthread_create() failed in FADBoard() (%s)", strerror(Ret));
57 }
58
59 // Start thread to connect to other sockets
60 DimThread::start();
61}
62
63//
64// Destructor
65//
66FADBoard::~FADBoard() {
67
68 int Ret;
69
70 // Cancel thread (if it did not quit already) and wait for it to quit
71 if ((Ret = pthread_cancel(Thread)) != 0 && Ret != ESRCH) {
72 m->Message(m->ERROR, "pthread_cancel() failed in ~FADBoard() (%s)", strerror(Ret));
73 }
74 if ((Ret = pthread_join(Thread, NULL)) != 0) {
75 m->Message(m->ERROR, "pthread_join() failed in ~FADBoard (%s)", strerror(Ret));
76 }
77
78 delete DIM_Name;
79 delete DIM_ID;
80 delete DIM_Temp;
81 delete DIM_DAC;
82 delete DIM_ROI;
83 delete[] Name;
84
85 // Delete condition variable
86 if ((Ret = pthread_cond_destroy(&CondVar)) != 0) {
87 m->Message(m->ERROR, "pthread_cond_destroy() failed in ~FADBoard (%s)", strerror(Ret));
88 }
89
90 // Delete mutex
91 if ((Ret = pthread_mutex_destroy(&Mutex)) != 0) {
92 m->Message(m->ERROR, "pthread_mutex_destroy() failed in ~FADBoard (%s)", strerror(Ret));
93 }
94}
95
96
97//
98// Send data to board
99//
100void FADBoard::Send(const void *Data, size_t Bytes) {
101
102 // Do not send if not active or communication problem
103 if (!Active || !CommOK) return;
104
105 // Write data
106 ssize_t Result = write(Socket, Data, Bytes);
107
108 // Check result
109 if (Result == -1) m->PrintMessage("Error: Could not write to socket (%s)\n", strerror(errno));
110 else if ((size_t) Result < Bytes) m->PrintMessage("Error: Could only write %d bytes out of %d to socket\n", Result, Bytes);
111}
112
113void FADBoard::Send(unsigned short Data) {
114
115 unsigned short Buffer = htons(Data);
116
117 Send(&Buffer, sizeof(unsigned short));
118}
119
120
121//
122// Get board status (mutex protected to avoid concurrent access in ReadLoop)
123//
124struct FADBoard::BoardStatus FADBoard::GetStatus() {
125
126 int Ret;
127 struct BoardStatus S;
128
129 // Lock
130 if ((Ret = pthread_mutex_lock(&Mutex)) != 0) {
131 m->Message(m->FATAL, "pthread_mutex_lock() failed in ReadLoop() (%s)", strerror(Ret));
132 }
133
134 S = Status;
135
136 // Unlock
137 if ((Ret = pthread_mutex_unlock(&Mutex)) != 0) {
138 m->Message(m->FATAL, "pthread_mutex_unlock() failed in Unlock() (%s)", strerror(Ret));
139 }
140
141 return S;
142}
143
144
145//
146// Perform amplitude calibration in steps
147//
148// The steps are intended to assure that up to date data is available
149void FADBoard::AmplitudeCalibration() {
150
151 vector<unsigned short> ROICmd;
152 unsigned short DACCmd[] = {htons(CMD_Write | (BADDR_DAC + 1)), 0, htons(CMD_Write | (BADDR_DAC + 2)), 0, htons(CMD_Write | (BADDR_DAC + 3)), 0};
153 string Message = string("ACALIBDONE")+Name;
154
155 switch (State) {
156 // ====== Part A: Check if amplitude calibration should start and initialise =====
157 case standbye:
158 if (m->Mode != m->acalib) break;
159
160 // Invalidate current calibration
161 ACalib.Time = -1;
162 Count = 0;
163
164 // Save initial board status, set all ROIs to 1024 and set DAC values
165 InitialStatus = GetStatus();
166
167 for (unsigned int i=0; i<NChips*NChannels; i++) {
168 ROICmd.push_back(htons(CMD_Write | (BADDR_ROI + i)));
169 ROICmd.push_back(htons(NBins));
170 }
171 Send(&ROICmd[0], ROICmd.size()*sizeof(unsigned short));
172
173 DACCmd[1] = htons(0);
174 DACCmd[3] = htons(0);
175 DACCmd[5] = htons(0);
176 Send(DACCmd, sizeof(DACCmd));
177
178 // Clear sum vector and set state to accumulate
179 memset(Sum, 0, sizeof(Sum));
180 State = baseline;
181 break;
182
183 // ====== Part B: Baseline calibration =====
184 case baseline:
185 // Check for stopping
186 if (m->Mode != m->acalib) {
187 State = cleanup;
188 break;
189 }
190
191 // Average
192 for (unsigned int Chip=0; Chip<NChips; Chip++) {
193 for (unsigned int Chan=0; Chan<NChannels; Chan++) {
194 for (int i=0; i<Status.ROI[Chip][Chan]; i++) {
195 Sum[Chip][Chan][(i+Status.TriggerCell[Chip]) % NBins] += Data[Chip][Chan][i];
196 }
197 }
198 }
199 Count++;
200
201 // Determine baseline if integration finished
202 if (Count < m->NumEventsRequested) break;
203
204 for (unsigned int i=0; i<NChips; i++) {
205 for (unsigned int j=0; j<NChannels; j++) {
206 for (unsigned int k=0; k<NBins; k++) {
207 ACalib.Baseline[i][j][k] = Sum[i][j][k] / m->NumEventsRequested;
208 }
209 }
210 }
211
212 // Set new DAC values and start accumulation
213 DACCmd[1] = htons(50000);
214 DACCmd[3] = htons(50000);
215 DACCmd[5] = htons(50000);
216 Send(DACCmd, sizeof(DACCmd));
217
218 // Clear sum vector and set state to accumulate
219 memset(Sum, 0, sizeof(Sum));
220 Count = 0;
221 State = gain;
222 break;
223
224 // ====== Part C: Gain calibration =====
225 case gain:
226 // Check for stopping
227 if (m->Mode != m->acalib) {
228 State = cleanup;
229 break;
230 }
231
232 // Average
233 for (unsigned int Chip=0; Chip<NChips; Chip++) {
234 for (unsigned int Chan=0; Chan<NChannels; Chan++) {
235 for (int i=0; i<Status.ROI[Chip][Chan]; i++) {
236 Sum[Chip][Chan][(i+Status.TriggerCell[Chip]) % NBins] += Data[Chip][Chan][i];
237 }
238 }
239 }
240 Count++;
241
242 // Determine gain if integration finished
243 if (Count < m->NumEventsRequested) break;
244
245 for (unsigned int i=0; i<NChips; i++) {
246 for (unsigned int j=0; j<NChannels; j++) {
247 for (unsigned int k=0; k<NBins; k++) {
248 ACalib.Gain[i][j][k] = (Sum[i][j][k] / m->NumEventsRequested) - ACalib.Baseline[i][j][k];
249 }
250 }
251 }
252
253 // Set new DAC values and start accumulation
254 DACCmd[1] = htons(0);
255 DACCmd[3] = htons(0);
256 DACCmd[5] = htons(0);
257 Send(DACCmd, sizeof(DACCmd));
258
259 // Clear sum vector and set state to accumulate
260 memset(Sum, 0, sizeof(Sum));
261 Count = 0;
262 State = secondary;
263 break;
264
265 // ====== Part D: Secondary calibration =====
266 case secondary:
267 // Check for stopping
268 if (m->Mode != m->acalib) {
269 State = cleanup;
270 break;
271 }
272
273 // Average
274 for (unsigned int Chip=0; Chip<NChips; Chip++) {
275 for (unsigned int Chan=0; Chan<NChannels; Chan++) {
276 for (int i=0; i<Status.ROI[Chip][Chan]; i++) {
277 Sum[Chip][Chan][i] = Data[Chip][Chan][i] - ACalib.Baseline[Chip][Chan][(i-Status.TriggerCell[Chip]) % NBins];
278 }
279 }
280 }
281 Count++;
282
283 // Determine secondary baseline if integration finished
284 if (Count < m->NumEventsRequested) break;
285
286 for (unsigned int i=0; i<NChips; i++) {
287 for (unsigned int j=0; j<NChannels; j++) {
288 for (unsigned int k=0; k<NBins; k++) {
289 ACalib.Secondary[i][j][k] = Sum[i][j][k] / (double) m->NumEventsRequested;
290 }
291 }
292 }
293
294 // Store calibration time and temperature
295 ACalib.DNA = Status.DNA;
296 ACalib.Frequency = Status.Frequency;
297 ACalib.Time = time(NULL);
298 ACalib.Temp = 0;
299 for (unsigned int i=0; i<NTemp; i++) ACalib.Temp += Status.Temp[i] / NTemp;
300
301 // Inform event thread that calibration is finished for this board
302 if (write(m->Pipe[1], Message.data(), Message.size()) == -1) {
303 m->Message(m->ERROR, "write() to Pipe[1] failed in class FADBoard::AmplitudeCalibration (%s)", strerror(errno));
304 }
305
306 State = cleanup;
307 break;
308
309 // ====== Part E: Write back original ROI and DAC settings =====
310 case cleanup:
311 // ROI values
312 ROICmd.clear();
313 for (unsigned int i=0; i<NChips*NChannels; i++) {
314 ROICmd.push_back(htons(CMD_Write | (BADDR_ROI + i)));
315 ROICmd.push_back(htons(InitialStatus.ROI[i/NChannels][i%NChannels]));
316 }
317 Send(&ROICmd[0], ROICmd.size()*sizeof(unsigned short));
318
319 // DAC values
320 DACCmd[1] = htons(InitialStatus.DAC[1]);
321 DACCmd[3] = htons(InitialStatus.DAC[2]);
322 DACCmd[5] = htons(InitialStatus.DAC[3]);
323 Send(DACCmd, sizeof(DACCmd));
324
325 State = wait;
326 break;
327
328 // ====== Wait for Mode not being idle =====
329 case wait:
330 if (m->Mode == m->idle) State = standbye;
331 break;
332 }
333}
334
335//
336// Connect to board and read data
337//
338void FADBoard::ReadLoop() {
339
340 char Buffer[READ_BUFFER_SIZE];
341 unsigned int Pos = 0, Temp;
342 const PEVNT_HEADER *Header = (PEVNT_HEADER *) Buffer;
343 ssize_t Result;
344 struct sockaddr_in SocketAddress;
345 struct BoardStatus PrevStatus;
346 int Ret;
347
348 // Resolve hostname
349 struct hostent *Host = gethostbyname(Name);
350 if (Host == 0) {
351 m->Message(m->WARN, "Could not resolve host name for %s", Name);
352 return;
353 }
354
355 SocketAddress.sin_family = PF_INET;
356 SocketAddress.sin_port = htons(Port);
357 SocketAddress.sin_addr = *(struct in_addr*) Host->h_addr;
358
359 // Open socket descriptor
360 if ((Socket = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
361 m->Message(m->ERROR, "Could not open socket for %s (%s)\n", Name, strerror(errno));
362 return;
363 }
364
365 // Connect to server
366 if (connect(Socket, (struct sockaddr *) &SocketAddress, sizeof(SocketAddress)) == -1) {
367 m->PrintMessage("Could not connect to %s at port %d (%s)\n", Name, Port, strerror(errno));
368 }
369 else {
370 CommOK = true;
371 Active = true;
372 }
373
374 memset(&PrevStatus, 0, sizeof(PrevStatus));
375
376 // Leave loop if program termination requested or board communication not OK
377 while (!m->ExitRequest && CommOK) {
378 // Read data from socket
379 Result = read(Socket, Buffer + Pos, sizeof(Buffer)-Pos);
380
381 // Check result of read
382 if (Result == -1) {
383 m->PrintMessage("Error: Could not read from socket, exiting read loop (%s)\n", strerror(errno));
384 CommOK = false;
385 break;
386 }
387 else if (Result == 0) {
388 m->PrintMessage("Server not existing anymore, exiting read loop\n");
389 CommOK = false;
390 break;
391 }
392
393 // If not active, discard incoming data
394 if (!Active) continue;
395
396 // Advance write pointer
397 Pos += Result;
398
399 // Check if internal buffer full
400 if (Pos == sizeof(Buffer)) {
401 m->PrintMessage("Internal buffer full, deleting all data in buffer\n");
402 Pos = 0;
403 continue;
404 }
405
406 // Check if buffer starts with start_package_flag, remove data if not
407 Temp = 0;
408 while (ntohs(*((unsigned short *) (Buffer+Temp))) != 0xfb01 && Temp<Pos) Temp++;
409 if (Temp != 0) {
410 memmove(Buffer, Buffer+Temp, Pos-Temp);
411 Pos -= Temp;
412 m->PrintMessage("Removed %d bytes because of start_package_flag not found for %s\n", Temp, Name);
413 continue;
414 }
415
416 // Wait until the buffer contains at least enough bytes to potentially hold a PEVNT_HEADER
417 if (Pos < sizeof(PEVNT_HEADER)) continue;
418
419 unsigned int Length = ntohs(Header->package_length)*2*sizeof(char);
420 if (Pos < Length) continue;
421
422 // Extract data if event end package flag correct
423 if (ntohs(*(unsigned short *) (Buffer+Length-sizeof(unsigned short))) == 0x04FE) {
424
425 // Prepare pointers to channel data (channels stored in order 0,9,18,27 - 1,10,19,28 - ... - 8,17,26,35)
426 PCHANNEL *Channel[NChips*NChannels], *Pnt=(PCHANNEL *) (Header+1);
427 for(unsigned int i=0; i<NChips*NChannels; i++) {
428 Channel[i] = Pnt;
429 Pnt = (PCHANNEL *) ((short *) (Channel[i] + 1) + ntohs(Channel[i]->roi));
430 }
431
432 PrevStatus = Status;
433
434 // Wait until event thread processed the previous data and lock to avoid concurrent access in GetStatus()
435 Lock();
436 while (!Continue) {
437 if ((Ret = pthread_cond_wait(&CondVar, &Mutex)) != 0) {
438 m->Message(m->ERROR, "pthread_cond_wait() failed (%s)", strerror(Ret));
439 }
440 }
441 gettimeofday(&Status.Update, NULL);
442
443 // Extract board and trigger information
444 Status.BoardID = ntohs(Header->board_id);
445 Status.FirmwareRevision = ntohs(Header->version_no);
446 Status.BoardTime = ntohl(Header->time);
447 Status.EventCounter = ntohl(Header->fad_evt_counter);
448 Status.TriggerID = ntohl(Header->trigger_id);
449 Status.TriggerType = ntohs(Header->trigger_type);
450 Status.TriggerCRC = ntohs(Header->trigger_crc);
451 Status.DNA = Header->DNA;
452
453 // Extract frequency related information
454 Status.Frequency = ntohl(Header->REFCLK_frequency)/1.0e3*2.048;
455 Status.PhaseShift = Header->adc_clock_phase_shift;
456 for (unsigned int i=0; i<NChips; i++) {
457 if ((ntohs(Header->PLLLCK)>>12 & (1<<i)) != 0) Status.Lock[i] = true;
458 else Status.Lock[i] = false;
459 }
460
461 // Extract Firmware status info
462 Status.denable = (bool) ( ntohs(Header->PLLLCK) & (1<<11) );
463 Status.dwrite = (bool) ( ntohs(Header->PLLLCK) & (1<<10) );
464 Status.DCM_lock = (bool) ( ntohs(Header->PLLLCK) & (1<<9) );
465 Status.DCM_ready = (bool) ( ntohs(Header->PLLLCK) & (1<<8) );
466 Status.spi_clk = (bool) ( ntohs(Header->PLLLCK) & (1<<7) );
467
468 // Extract temperatures (MSB indicates if temperature is positive or negative)
469 for (unsigned int i=0; i<NTemp; i++) {
470 if ((ntohs(Header->drs_temperature[i]) & 0x8000) == 0) Status.Temp[i] = float(ntohs(Header->drs_temperature[i]) >> 3)/16;
471 else Status.Temp[i] = float(0xE000 | (ntohs(Header->drs_temperature[i])) >> 3)/16;
472 }
473
474 // Extract DAC channels
475 for (unsigned int i=0; i<NDAC; i++) Status.DAC[i] = ntohs(Header->dac[i]);
476
477 short Buf;
478 for (unsigned int Chip=0; Chip<NChips; Chip++) {
479 // Extract trigger cells
480 Status.TriggerCell[Chip] = (int) ntohs(Channel[Chip]->start_cell);
481
482 for (unsigned int Chan=0; Chan<NChannels; Chan++) {
483 // Extract ROI
484 Status.ROI[Chip][Chan] = ntohs(Channel[Chip+NChips*Chan]->roi);
485
486 // Extract ADC data (stored in 12 bit signed twis complement with out-of-range-bit and leading zeroes)
487 for (int i=0; i<Status.ROI[Chip][Chan]; i++) {
488 Buf = ntohs(Channel[Chip+NChips*Chan]->adc_data[i]);
489 (Buf <<= 4) >>= 4; //delete the sign-bit by shifting left and shift back
490 Data[Chip][Chan][i] = Buf;
491 }
492 }
493 }
494
495 // Prepare predicate for condition variable
496 Continue = false;
497 Unlock();
498
499 // Amplitude calibration (will check if Mode is acalib)
500 AmplitudeCalibration();
501
502 // Update DIM services if necessary
503 if (memcmp(PrevStatus.Temp, Status.Temp, sizeof(Status.Temp)) != 0) {
504 DIM_Temp->updateService(Status.Temp, sizeof(Status.Temp));
505 }
506 if (memcmp(PrevStatus.DAC, Status.DAC, sizeof(Status.DAC)) != 0) {
507 DIM_DAC->updateService(Status.DAC, sizeof(Status.DAC));
508 }
509 if (memcmp(PrevStatus.ROI, Status.ROI, sizeof(Status.ROI)) != 0) {
510 DIM_ROI->updateService(Status.ROI, sizeof(Status.ROI));
511 }
512 if (PrevStatus.BoardID != Status.BoardID) {
513 DIM_ID->updateService(&Status.BoardID, sizeof(Status.BoardID));
514 }
515
516 // Inform event thread of new data
517 string Message = string("EVENT")+Name;
518 if (write(m->Pipe[1], Message.data(), Message.size()) == -1) {
519 m->Message(m->ERROR, "write() to Pipe[1] failed in class FADBoard (%s)", strerror(errno));
520 m->ExitRequest = true;
521 }
522 }
523 else m->PrintMessage("End package flag incorrect, removing corrupt event\n");
524
525 // Remove event data from internal buffer
526 memmove(Buffer, Buffer+Length, Pos-Length);
527 Pos = Pos-Length;
528 } // while()
529
530 // Set inactive and close socket descriptor
531 Active = false;
532
533 if (close(Socket) == -1) {
534 m->PrintMessage("Could not close socket descriptor for board %s (%s)", Name, strerror(errno));
535 }
536
537}
538
539
540//
541// Launch read thread inside class
542//
543void FADBoard::LaunchThread(class FADBoard *m) {
544
545 m->ReadLoop();
546}
547
548
549//
550// Lock and unlock mutex
551//
552void FADBoard::Lock() {
553
554 int Ret;
555
556 if ((Ret = pthread_mutex_lock(&Mutex)) != 0) {
557 m->Message(m->FATAL, "pthread_mutex_lock() failed in class FADBoard (%s)", strerror(Ret));
558 }
559}
560
561void FADBoard::Unlock() {
562
563 int Ret;
564
565 if ((Ret = pthread_mutex_unlock(&Mutex)) != 0) {
566 m->Message(m->FATAL, "pthread_mutex_unlock() failed in class FADBoard (%s)", strerror(Ret));
567 }
568}
569
570
571//
572// Open other sockets
573//
574void FADBoard::threadHandler() {
575
576 int List[] = {5001, 5002, 5003, 5004, 5005, 5006, 5007};
577 int Socket[sizeof(List)/sizeof(int)], MaxSocketNum, Ret;
578 fd_set DescriptorList;
579 char Buffer[1000000];
580
581 // Resolve hostname
582 struct hostent *Host = gethostbyname(Name);
583 if (Host == 0) {
584 m->PrintMessage("OtherSockets: Could not resolve host name for %s\n", Name);
585 return;
586 }
587
588 // Connect to server
589 struct sockaddr_in SocketAddress;
590 SocketAddress.sin_family = PF_INET;
591 SocketAddress.sin_addr = *(struct in_addr*) Host->h_addr;
592
593 for (unsigned int i=0; i<sizeof(List)/sizeof(int); i++) {
594 // Open socket descriptor
595 if ((Socket[i] = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
596 m->PrintMessage("OtherSockets: Could not open socket for port %d (%s)\n", List[i], strerror(errno));
597 return;
598 }
599 MaxSocketNum = *max_element(Socket, Socket+sizeof(List)/sizeof(int));
600
601 // Connect to server
602 SocketAddress.sin_port = htons((unsigned short) List[i]);
603 if (connect(Socket[i], (struct sockaddr *) &SocketAddress, sizeof(SocketAddress)) == -1) {
604 m->PrintMessage("OtherSockets: Could not connect to port %d (%s)\n", List[i], strerror(errno));
605 return;
606 }
607 }
608
609 while(true) {
610 // Wait for data from sockets
611 FD_ZERO(&DescriptorList);
612 for (unsigned int i=0; i<sizeof(List)/sizeof(int); i++) FD_SET(Socket[i], &DescriptorList);
613 if (select(MaxSocketNum+1, &DescriptorList, NULL, NULL, NULL) == -1) {
614 m->PrintMessage("OtherSockets: Error with select() (%s)\n", strerror(errno));
615 break;
616 }
617
618 // Data from socket
619 for (unsigned int i=0; i<sizeof(List)/sizeof(int); i++) if (FD_ISSET(Socket[i], &DescriptorList)) {
620 Ret = read(Socket[i], Buffer, sizeof(Buffer));
621 if(Ret == 0) m->PrintMessage("OtherSockets: Connection to port %d not existing anymore\n", List[i]);
622 else if (Ret == -1) m->PrintMessage("OtherSockets: Error reading from port %d (%s)\n", List[i], strerror(errno));
623 }
624 }
625
626 // Close all sockets
627 for (unsigned int i=0; i<sizeof(List)/sizeof(int); i++) {
628 if ((Socket[i] != -1) && (close(Socket[i]) == -1)) {
629 m->PrintMessage("OtherSockets: Could not close socket of port %d (%s)", List[i], strerror(errno));
630 }
631 }
632}
Note: See TracBrowser for help on using the repository browser.