|
Last change
on this file since 554 was 248, checked in by dneise, 15 years ago |
|
initial check in of FAD tools
simple daq - simple command line interface to FAD
will produce binary socket_x.dat files
ddd_for_fad - simple GUI
able to plot FAD raw data.
|
|
File size:
436 bytes
|
| Line | |
|---|
| 1 |
|
|---|
| 2 | #include <sys/socket.h>
|
|---|
| 3 | #include <arpa/inet.h>
|
|---|
| 4 | #include <signal.h>
|
|---|
| 5 |
|
|---|
| 6 | void OpenSockets(int *SocketDiscriptor, int max_fd){
|
|---|
| 7 |
|
|---|
| 8 | for (int i = 0; i < NR_OF_SOCKETS; i++)
|
|---|
| 9 | {
|
|---|
| 10 | if ((SocketDescriptor[i] = socket (PF_INET, SOCK_STREAM, 0)) == -1)
|
|---|
| 11 | {
|
|---|
| 12 | printf ("Error: Could not open socket Nr.: %d\n", i);
|
|---|
| 13 | exit_program (EXIT_FAILURE);
|
|---|
| 14 | }
|
|---|
| 15 | else
|
|---|
| 16 | {
|
|---|
| 17 | if (SocketDescriptor[i] > max_fd)
|
|---|
| 18 | {
|
|---|
| 19 | max_fd = SocketDescriptor[i];
|
|---|
| 20 | }
|
|---|
| 21 | }
|
|---|
| 22 | }
|
|---|
| 23 |
|
|---|
| 24 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.