summaryrefslogtreecommitdiffstats
path: root/UnixDomainSocketServer
diff options
context:
space:
mode:
Diffstat (limited to 'UnixDomainSocketServer')
-rwxr-xr-xUnixDomainSocketServer/Debug/UnixDomainSocketServerbin54333 -> 0 bytes
-rw-r--r--UnixDomainSocketServer/Debug/makefile43
-rw-r--r--UnixDomainSocketServer/Debug/objects.mk7
-rw-r--r--UnixDomainSocketServer/Debug/server.d3
-rw-r--r--UnixDomainSocketServer/Debug/sources.mk17
-rw-r--r--UnixDomainSocketServer/Debug/subdir.mk24
-rw-r--r--UnixDomainSocketServer/Makefile5
-rwxr-xr-xUnixDomainSocketServer/serverbin10209 -> 0 bytes
-rw-r--r--UnixDomainSocketServer/server.c78
9 files changed, 0 insertions, 177 deletions
diff --git a/UnixDomainSocketServer/Debug/UnixDomainSocketServer b/UnixDomainSocketServer/Debug/UnixDomainSocketServer
deleted file mode 100755
index a7fbc06..0000000
--- a/UnixDomainSocketServer/Debug/UnixDomainSocketServer
+++ /dev/null
Binary files differ
diff --git a/UnixDomainSocketServer/Debug/makefile b/UnixDomainSocketServer/Debug/makefile
deleted file mode 100644
index 63e11e5..0000000
--- a/UnixDomainSocketServer/Debug/makefile
+++ /dev/null
@@ -1,43 +0,0 @@
-################################################################################
-# Automatically-generated file. Do not edit!
-################################################################################
-
--include ../makefile.init
-
-RM := rm -rf
-
-# All of the sources participating in the build are defined here
--include sources.mk
--include subdir.mk
--include objects.mk
-
-ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(strip $(C_DEPS)),)
--include $(C_DEPS)
-endif
-endif
-
--include ../makefile.defs
-
-# Add inputs and outputs from these tool invocations to the build variables
-
-# All Target
-all: UnixDomainSocketServer
-
-# Tool invocations
-UnixDomainSocketServer: $(OBJS) $(USER_OBJS)
- @echo 'Building target: $@'
- @echo 'Invoking: GCC C Linker'
- gcc -o"UnixDomainSocketServer" $(OBJS) $(USER_OBJS) $(LIBS)
- @echo 'Finished building target: $@'
- @echo ' '
-
-# Other Targets
-clean:
- -$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) UnixDomainSocketServer
- -@echo ' '
-
-.PHONY: all clean dependents
-.SECONDARY:
-
--include ../makefile.targets
diff --git a/UnixDomainSocketServer/Debug/objects.mk b/UnixDomainSocketServer/Debug/objects.mk
deleted file mode 100644
index 224ef68..0000000
--- a/UnixDomainSocketServer/Debug/objects.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-################################################################################
-# Automatically-generated file. Do not edit!
-################################################################################
-
-USER_OBJS :=
-
-LIBS :=
diff --git a/UnixDomainSocketServer/Debug/server.d b/UnixDomainSocketServer/Debug/server.d
deleted file mode 100644
index c22def6..0000000
--- a/UnixDomainSocketServer/Debug/server.d
+++ /dev/null
@@ -1,3 +0,0 @@
-server.d server.o: ../server.c ../../common/fbgui.h
-
-../../common/fbgui.h:
diff --git a/UnixDomainSocketServer/Debug/sources.mk b/UnixDomainSocketServer/Debug/sources.mk
deleted file mode 100644
index df1db10..0000000
--- a/UnixDomainSocketServer/Debug/sources.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-################################################################################
-# Automatically-generated file. Do not edit!
-################################################################################
-
-O_SRCS :=
-C_SRCS :=
-S_UPPER_SRCS :=
-OBJ_SRCS :=
-ASM_SRCS :=
-OBJS :=
-C_DEPS :=
-EXECUTABLES :=
-
-# Every subdirectory with source files must be described here
-SUBDIRS := \
-. \
-
diff --git a/UnixDomainSocketServer/Debug/subdir.mk b/UnixDomainSocketServer/Debug/subdir.mk
deleted file mode 100644
index eb4a214..0000000
--- a/UnixDomainSocketServer/Debug/subdir.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Automatically-generated file. Do not edit!
-################################################################################
-
-# Add inputs and outputs from these tool invocations to the build variables
-C_SRCS += \
-../server.c
-
-OBJS += \
-./server.o
-
-C_DEPS += \
-./server.d
-
-
-# Each subdirectory must supply rules for building sources it contributes
-%.o: ../%.c
- @echo 'Building file: $<'
- @echo 'Invoking: GCC C Compiler'
- gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
- @echo 'Finished building: $<'
- @echo ' '
-
-
diff --git a/UnixDomainSocketServer/Makefile b/UnixDomainSocketServer/Makefile
deleted file mode 100644
index 373b23f..0000000
--- a/UnixDomainSocketServer/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-all:
- gcc -g -Wall server.c -o server
-
-clean:
- rm -f server
diff --git a/UnixDomainSocketServer/server b/UnixDomainSocketServer/server
deleted file mode 100755
index 1811a94..0000000
--- a/UnixDomainSocketServer/server
+++ /dev/null
Binary files differ
diff --git a/UnixDomainSocketServer/server.c b/UnixDomainSocketServer/server.c
deleted file mode 100644
index ce776b1..0000000
--- a/UnixDomainSocketServer/server.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-#include "../common/fbgui.h"
-
-void error(const char *msg) {
- perror(msg);
- exit(1);
-}
-
-int main(int argc, char *argv[]) {
- int sockfd, newsockfd;
- socklen_t clilen;
- char buffer[DHCP_MESSAGE_SIZE];
- const char ack[ACK_SIZE] = "ACK";
- struct sockaddr_un serv_addr, cli_addr;
- int n;
-
- sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
- if (sockfd < 0)
- error("ERROR opening socket");
-
- bzero((char *) &serv_addr, sizeof(serv_addr));
-
- serv_addr.sun_family = AF_UNIX;
- strcpy(serv_addr.sun_path, "/var/tmp/qt_c_socket_default");
- unlink("/var/tmp/qt_c_socket_default");
- if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0)
- error("ERROR on binding");
-
- if (listen(sockfd, 5) == -1) {
- error("ERROR on listen");
- }
-
-
- for (;;) {
- int done;
- printf("Waiting for a connection...\n");
- clilen = sizeof(cli_addr);
-
- newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen);
- if (newsockfd < 0)
- error("ERROR on accept");
-
- printf("Connected.\n");
- done = 0;
-
- do {
- bzero(buffer, DHCP_MESSAGE_SIZE);
- n = read(newsockfd, buffer, DHCP_MESSAGE_SIZE);
- if (n <= 0) {
- if (n<0) error("ERROR reading from socket");
- done = 1;
- }
- // search for last newline and replace it with a null
- char * pch;
- pch=strrchr(buffer,'\n');
- buffer[pch-buffer] = '\0';
- printf("Here is the message: \"%s\"\n", buffer);
- if(!done) {
- printf("send ACK\n");
- if (send(newsockfd, ack, ACK_SIZE, 0) < 0) {
- error("ERROR on send");
- done = 1;
- }
- }
- } while (!done);
- close(newsockfd);
- }
-
- close(sockfd);
- return 0;
-}