Completed basic socket work.

Processes multiple requests concurrently (single thread).
Currently just echos received data.
This commit is contained in:
2014-07-17 00:17:30 +01:00
parent 0646b6bf72
commit d556df830f
15 changed files with 2779 additions and 31 deletions

View File

@@ -35,7 +35,8 @@ OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
# Object Files
OBJECTFILES= \
${OBJECTDIR}/main.o
${OBJECTDIR}/src/main.o \
${OBJECTDIR}/src/socket.o
# C Compiler Flags
@@ -62,10 +63,15 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/khttp: ${OBJECTFILES}
${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
${LINK.c} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/khttp ${OBJECTFILES} ${LDLIBSOPTIONS}
${OBJECTDIR}/main.o: main.c
${MKDIR} -p ${OBJECTDIR}
${OBJECTDIR}/src/main.o: src/main.c
${MKDIR} -p ${OBJECTDIR}/src
${RM} "$@.d"
$(COMPILE.c) -g -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.c
$(COMPILE.c) -g -Wall -std=c99 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/main.o src/main.c
${OBJECTDIR}/src/socket.o: src/socket.c
${MKDIR} -p ${OBJECTDIR}/src
${RM} "$@.d"
$(COMPILE.c) -g -Wall -std=c99 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/socket.o src/socket.c
# Subprojects
.build-subprojects:

View File

@@ -35,7 +35,8 @@ OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
# Object Files
OBJECTFILES= \
${OBJECTDIR}/main.o
${OBJECTDIR}/src/main.o \
${OBJECTDIR}/src/socket.o
# C Compiler Flags
@@ -62,10 +63,15 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/khttp: ${OBJECTFILES}
${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
${LINK.c} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/khttp ${OBJECTFILES} ${LDLIBSOPTIONS}
${OBJECTDIR}/main.o: main.c
${MKDIR} -p ${OBJECTDIR}
${OBJECTDIR}/src/main.o: src/main.c
${MKDIR} -p ${OBJECTDIR}/src
${RM} "$@.d"
$(COMPILE.c) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.c
$(COMPILE.c) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/main.o src/main.c
${OBJECTDIR}/src/socket.o: src/socket.c
${MKDIR} -p ${OBJECTDIR}/src
${RM} "$@.d"
$(COMPILE.c) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/socket.o src/socket.c
# Subprojects
.build-subprojects:

View File

@@ -4,6 +4,8 @@
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
<itemPath>src/main.h</itemPath>
<itemPath>src/socket.h</itemPath>
</logicalFolder>
<logicalFolder name="ResourceFiles"
displayName="Resource Files"
@@ -12,7 +14,8 @@
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>main.c</itemPath>
<itemPath>src/main.c</itemPath>
<itemPath>src/socket.c</itemPath>
</logicalFolder>
<logicalFolder name="TestFiles"
displayName="Test Files"
@@ -26,6 +29,9 @@
<itemPath>Makefile</itemPath>
</logicalFolder>
</logicalFolder>
<sourceRootList>
<Elem>include</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="Debug" type="1">
@@ -35,8 +41,18 @@
<rebuildPropChanged>false</rebuildPropChanged>
</toolsSet>
<compileType>
<cTool>
<standard>3</standard>
<warningLevel>2</warningLevel>
</cTool>
</compileType>
<item path="main.c" ex="false" tool="0" flavor2="0">
<item path="src/main.c" ex="false" tool="0" flavor2="0">
</item>
<item path="src/main.h" ex="false" tool="3" flavor2="0">
</item>
<item path="src/socket.c" ex="false" tool="0" flavor2="0">
</item>
<item path="src/socket.h" ex="false" tool="3" flavor2="0">
</item>
</conf>
<conf name="Release" type="1">
@@ -59,7 +75,13 @@
<developmentMode>5</developmentMode>
</asmTool>
</compileType>
<item path="main.c" ex="false" tool="0" flavor2="0">
<item path="src/main.c" ex="false" tool="0" flavor2="0">
</item>
<item path="src/main.h" ex="false" tool="3" flavor2="0">
</item>
<item path="src/socket.c" ex="false" tool="0" flavor2="0">
</item>
<item path="src/socket.h" ex="false" tool="3" flavor2="0">
</item>
</conf>
</confs>

View File

@@ -13,6 +13,8 @@
<gdb_interceptlist>
<gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
</gdb_interceptlist>
<gdb_signals>
</gdb_signals>
<gdb_options>
<DebugOptions>
</DebugOptions>

View File

@@ -4,4 +4,14 @@
<activeConfTypeElem>1</activeConfTypeElem>
<activeConfIndexElem>0</activeConfIndexElem>
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/home/sam/NetBeansProjects/KHttp/src/socket.c</file>
<file>file:/home/sam/NetBeansProjects/KHttp/src/main.h</file>
<file>file:/home/sam/NetBeansProjects/KHttp/src/main.c</file>
<file>file:/home/sam/NetBeansProjects/KHttp/src/ut/utlist.h</file>
<file>file:/home/sam/NetBeansProjects/KHttp/src/socket.h</file>
</group>
</open-files>
</project-private>

View File

@@ -6,10 +6,12 @@
<name>KHttp</name>
<c-extensions>c</c-extensions>
<cpp-extensions/>
<header-extensions/>
<header-extensions>h</header-extensions>
<sourceEncoding>UTF-8</sourceEncoding>
<make-dep-projects/>
<sourceRootList/>
<sourceRootList>
<sourceRootElem>include</sourceRootElem>
</sourceRootList>
<confList>
<confElem>
<name>Debug</name>