#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <netinet/in.h>
#include <string.h>
#include <signal.h>
#include <errno.h>
#include <unistd.h>
#include <pthread.h>
#include <stdint.h>
#include <time.h>
◆ CMDLEN
◆ DATAHEADERLEN
#define DATAHEADERLEN 252 |
◆ HEADER_LEN
◆ MAXDATA
#define MAXDATA 256*256*2*2 |
◆ MAXLINE
Simple TCP server to simulate a merlin Labview system.
Arguments: port number - port number to listen for connections
Matthew Pearson Oct 2011
Giles Knap Jan 2012
◆ MPX_PROFILE_LEN
#define MPX_PROFILE_LEN 256 * 8 |
◆ MPX_SUM_LEN
◆ commandThread()
void * commandThread |
( |
void * |
command_fd | ) |
|
◆ dataThread()
void * dataThread |
( |
void * |
data_fd | ) |
|
◆ echo_request()
int echo_request |
( |
int |
socket_fd | ) |
|
Read from socket and send back response.
Read a maximum of MAXLINE, or until a newline, then echo the command back.
Read until end of current block (header or body)
◆ endian_swap()
void endian_swap |
( |
uint64_t * |
x | ) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
◆ produce_data()
int produce_data |
( |
int |
socket_fd | ) |
|
Produce simulation data when we start acquisition.
◆ sig_chld()
void sig_chld |
( |
int |
signo | ) |
|
Signal handler for SIGCHLD.
NOT NEEDED NOW WE ARE USING PTHREADS.
◆ data_exit
◆ Depth
◆ do_data
◆ do_data_cond
pthread_cond_t do_data_cond = PTHREAD_COND_INITIALIZER |
◆ do_data_mutex
pthread_mutex_t do_data_mutex = PTHREAD_MUTEX_INITIALIZER |
◆ frame_count
◆ frames_to_send
◆ incrementer