Skip to content

Commit

Permalink
Update new version of NetworkUtilities library.
Browse files Browse the repository at this point in the history
  • Loading branch information
m053m716 committed Feb 15, 2024
1 parent 3eea4bd commit 6f41e75
Show file tree
Hide file tree
Showing 23 changed files with 100 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">NetworkUtilities<span id="projectnumber">&#160;1.1.0</span>
<div id="projectname">NetworkUtilities<span id="projectnumber">&#160;1.2.0</span>
</div>
<div id="projectbrief">A small compiled library for C network utility functions. The library was compiled for Windows 64-bit and should work with 64- or 32-bit windows architectures.</div>
<div id="projectbrief">A small compiled library for C network utility functions.</div>
</td>
</tr>
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/NetworkUtilities/html/group___clean_up.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">NetworkUtilities<span id="projectnumber">&#160;1.1.0</span>
<div id="projectname">NetworkUtilities<span id="projectnumber">&#160;1.2.0</span>
</div>
<div id="projectbrief">A small compiled library for C network utility functions. The library was compiled for Windows 64-bit and should work with 64- or 32-bit windows architectures.</div>
<div id="projectbrief">A small compiled library for C network utility functions.</div>
</td>
</tr>
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/NetworkUtilities/html/group___messaging.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">NetworkUtilities<span id="projectnumber">&#160;1.1.0</span>
<div id="projectname">NetworkUtilities<span id="projectnumber">&#160;1.2.0</span>
</div>
<div id="projectbrief">A small compiled library for C network utility functions. The library was compiled for Windows 64-bit and should work with 64- or 32-bit windows architectures.</div>
<div id="projectbrief">A small compiled library for C network utility functions.</div>
</td>
</tr>
</tbody>
Expand Down
45 changes: 43 additions & 2 deletions docs/docs/NetworkUtilities/html/group___port_creation.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">NetworkUtilities<span id="projectnumber">&#160;1.1.0</span>
<div id="projectname">NetworkUtilities<span id="projectnumber">&#160;1.2.0</span>
</div>
<div id="projectbrief">A small compiled library for C network utility functions. The library was compiled for Windows 64-bit and should work with 64- or 32-bit windows architectures.</div>
<div id="projectbrief">A small compiled library for C network utility functions.</div>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -118,6 +118,9 @@
<tr class="memitem:ga3eb74aed34ee71625a337a5fa9a4f5ba" id="r_ga3eb74aed34ee71625a337a5fa9a4f5ba"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga3eb74aed34ee71625a337a5fa9a4f5ba">setNonBlocking</a> (SOCKET socket)</td></tr>
<tr class="memdesc:ga3eb74aed34ee71625a337a5fa9a4f5ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the given socket to non-blocking mode. <br /></td></tr>
<tr class="separator:ga3eb74aed34ee71625a337a5fa9a4f5ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga54467c11765690526ab81ece02e18927" id="r_ga54467c11765690526ab81ece02e18927"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga54467c11765690526ab81ece02e18927">updateServerIPandPort</a> (struct sockaddr_in *serverAddr, char *serverIP, uint16_t serverPort)</td></tr>
<tr class="memdesc:ga54467c11765690526ab81ece02e18927"><td class="mdescLeft">&#160;</td><td class="mdescRight">Re-configure server address and port. <br /></td></tr>
<tr class="separator:ga54467c11765690526ab81ece02e18927"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Functions related to initializing network ports and setting their properties. </p>
Expand Down Expand Up @@ -277,6 +280,44 @@ <h2 class="memtitle"><span class="permalink"><a href="#ga3eb74aed34ee71625a337a5
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

</div>
</div>
<a id="ga54467c11765690526ab81ece02e18927" name="ga54467c11765690526ab81ece02e18927"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga54467c11765690526ab81ece02e18927">&#9670;&#160;</a></span>updateServerIPandPort()</h2>

<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void updateServerIPandPort </td>
<td>(</td>
<td class="paramtype">struct sockaddr_in *</td> <td class="paramname"><span class="paramname"><em>serverAddr</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *</td> <td class="paramname"><span class="paramname"><em>serverIP</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint16_t</td> <td class="paramname"><span class="paramname"><em>serverPort</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">

<p>Re-configure server address and port. </p>
<p>This function re-configures the server address and port using the provided input IPv4 IP address and port number. <br />
</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">serverAddr</td><td>Pointer to the address structure of the server connection (struct sockaddr_in) to configure the socket with. </td></tr>
<tr><td class="paramname">serverIP</td><td>The IP address of the connection (char*; IPv4). </td></tr>
<tr><td class="paramname">serverPort</td><td>The port on the server that will be bound by this UDP socket. </td></tr>
</table>
</dd>
</dl>

</div>
</div>
</div><!-- contents -->
Expand Down
3 changes: 2 additions & 1 deletion docs/docs/NetworkUtilities/html/group___port_creation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ var group___port_creation =
[ "initializeUDPServerSocket", "group___port_creation.html#ga886364c39477e6170b570627298b8b69", null ],
[ "initializeWinsock", "group___port_creation.html#ga5ee93bf6ea9d1f37eedb43e05ebf0157", null ],
[ "setBlocking", "group___port_creation.html#ga26cae777cee8ec996251dab63cb40da7", null ],
[ "setNonBlocking", "group___port_creation.html#ga3eb74aed34ee71625a337a5fa9a4f5ba", null ]
[ "setNonBlocking", "group___port_creation.html#ga3eb74aed34ee71625a337a5fa9a4f5ba", null ],
[ "updateServerIPandPort", "group___port_creation.html#ga54467c11765690526ab81ece02e18927", null ]
];
32 changes: 12 additions & 20 deletions docs/docs/NetworkUtilities/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">NetworkUtilities<span id="projectnumber">&#160;1.1.0</span>
<div id="projectname">NetworkUtilities<span id="projectnumber">&#160;1.2.0</span>
</div>
<div id="projectbrief">A small compiled library for C network utility functions. The library was compiled for Windows 64-bit and should work with 64- or 32-bit windows architectures.</div>
<div id="projectbrief">A small compiled library for C network utility functions.</div>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -102,31 +102,23 @@ <h1><a class="anchor" id="contents"></a>
Contents</h1>
<ul>
<li><a class="el" href="#compiling">Compiling</a><ul>
<li><a class="el" href="#dynamic-link-library">Dynamic</a></li>
<li><a class="el" href="#static-library">Static</a></li>
<li><a class="el" href="#library">Library</a></li>
<li><a class="el" href="#copying">Copying</a></li>
<li><a class="el" href="#for-external-use">In Other Projects</a></li>
</ul>
</li>
<li><a class="el" href="#note-about-gcc">Using `gcc` on Windows</a></li>
</ul>
<h1><a class="anchor" id="compiling"></a>
Compiling</h1>
<h2><a class="anchor" id="dynamic-link-library"></a>
Dynamic Link Library</h2>
<p>To re-compile the dynamic link library (<code>.dll</code>), use the following command: <br />
</p><div class="fragment"><div class="line">gcc -shared -o bin/Network.dll -Iinclude src/network.c -lws2_32 -Llib -lDataStructures</div>
</div><!-- fragment --><ul>
<li>The <code>-shared</code> option creates a shared object. <br />
</li>
<li>The <code>-o</code> is what the output file is. <br />
</li>
<li>The <code>-lws2_32</code> option links against the <code>winsock2</code> library. <br />
</li>
</ul>
<h2><a class="anchor" id="static-library"></a>
Static Library</h2>
<p>To re-compile the static library (<code>.lib</code>), use the following command: <br />
</p><div class="fragment"><div class="line">gcc -c src/network.c -Iinclude -o lib/network.o -lws2_32 -Llib -lDataStructures &amp;&amp; ar rcs lib/Network.lib lib/network.o</div>
<h2><a class="anchor" id="library"></a>
Library</h2>
<p>To re-compile the dynamic link library (<code>.dll</code>) and static link library (<code>.lib</code>), use the following command: <br />
</p><div class="fragment"><div class="line">gcc -shared -o bin/Network.dll -Iinclude src/network.c -lws2_32 -Llib -lDataStructures -lTiming &amp;&amp; gcc -c src/network.c -Iinclude -o lib/network.o -lws2_32 -Llib -lDataStructures -lTiming &amp;&amp; ar rcs lib/Network.lib lib/network.o</div>
</div><!-- fragment --><h2><a class="anchor" id="copying"></a>
Copying</h2>
<p>To copy the re-compiled library and header to the relevant projects, use the following command: <br />
</p><div class="fragment"><div class="line">cp src/network.h ../StateServer/include/network.h &amp;&amp; cp lib/Network.lib ../StateServer/lib/Network.lib</div>
</div><!-- fragment --><h2><a class="anchor" id="for-external-use"></a>
For External Use</h2>
<p>Assume we have the following project folder structure: <br />
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/NetworkUtilities/html/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var index =
[
[ "Contents", "index.html#contents", null ],
[ "Compiling", "index.html#compiling", [
[ "Dynamic Link Library", "index.html#dynamic-link-library", null ],
[ "Static Library", "index.html#static-library", null ],
[ "Library", "index.html#library", null ],
[ "Copying", "index.html#copying", null ],
[ "For External Use", "index.html#for-external-use", null ]
] ],
[ "Note about gcc", "index.html#note-about-gcc", null ]
Expand Down
5 changes: 3 additions & 2 deletions docs/docs/NetworkUtilities/html/navtreeindex0.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ var NAVTREEINDEX0 =
"group___port_creation.html":[1,0],
"group___port_creation.html#ga26cae777cee8ec996251dab63cb40da7":[1,0,3],
"group___port_creation.html#ga3eb74aed34ee71625a337a5fa9a4f5ba":[1,0,4],
"group___port_creation.html#ga54467c11765690526ab81ece02e18927":[1,0,5],
"group___port_creation.html#ga5ee93bf6ea9d1f37eedb43e05ebf0157":[1,0,2],
"group___port_creation.html#ga886364c39477e6170b570627298b8b69":[1,0,1],
"group___port_creation.html#gaea2e8433844f1fe499127f1ec0aa089b":[1,0,0],
"index.html":[],
"index.html":[0],
"index.html#compiling":[0,1],
"index.html#contents":[0,0],
"index.html#dynamic-link-library":[0,1,0],
"index.html#copying":[0,1,1],
"index.html#for-external-use":[0,1,2],
"index.html#library":[0,1,0],
"index.html#note-about-gcc":[0,2],
"index.html#static-library":[0,1,1],
"pages.html":[],
"topics.html":[1]
};
3 changes: 2 additions & 1 deletion docs/docs/NetworkUtilities/html/search/all_1.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ var searchData=
['cleanupwinsock_1',['cleanupWinsock',['../group___clean_up.html#ga1af42a80836683ce46af20b6768565bb',1,'cleanupWinsock():&#160;network.c'],['../group___clean_up.html#ga1af42a80836683ce46af20b6768565bb',1,'cleanupWinsock():&#160;network.c']]],
['compiling_2',['Compiling',['../index.html#compiling',1,'']]],
['contents_3',['Contents',['../index.html#contents',1,'']]],
['creation_4',['Port Creation',['../group___port_creation.html',1,'']]]
['copying_4',['Copying',['../index.html#copying',1,'']]],
['creation_5',['Port Creation',['../group___port_creation.html',1,'']]]
];
2 changes: 1 addition & 1 deletion docs/docs/NetworkUtilities/html/search/all_2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['dynamic_20link_20library_0',['Dynamic Link Library',['../index.html#dynamic-link-library',1,'']]]
['external_20use_0',['For External Use',['../index.html#for-external-use',1,'']]]
];
2 changes: 1 addition & 1 deletion docs/docs/NetworkUtilities/html/search/all_3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['external_20use_0',['For External Use',['../index.html#for-external-use',1,'']]]
['for_20external_20use_0',['For External Use',['../index.html#for-external-use',1,'']]]
];
2 changes: 1 addition & 1 deletion docs/docs/NetworkUtilities/html/search/all_4.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['for_20external_20use_0',['For External Use',['../index.html#for-external-use',1,'']]]
['gcc_0',['Note about gcc',['../index.html#note-about-gcc',1,'']]]
];
4 changes: 3 additions & 1 deletion docs/docs/NetworkUtilities/html/search/all_5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions docs/docs/NetworkUtilities/html/search/all_6.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
var searchData=
[
['initializeudpclientsocket_0',['initializeUDPClientSocket',['../group___port_creation.html#gaea2e8433844f1fe499127f1ec0aa089b',1,'initializeUDPClientSocket(SOCKET *udpSocket, struct sockaddr_in *serverAddr, char *serverIP, uint16_t port):&#160;network.c'],['../group___port_creation.html#gaea2e8433844f1fe499127f1ec0aa089b',1,'initializeUDPClientSocket(SOCKET *udpSocket, struct sockaddr_in *serverAddr, char *serverIP, uint16_t port):&#160;network.c']]],
['initializeudpserversocket_1',['initializeUDPServerSocket',['../group___port_creation.html#ga886364c39477e6170b570627298b8b69',1,'initializeUDPServerSocket(SOCKET *udpSocket, struct sockaddr_in *serverAddr, uint16_t port):&#160;network.c'],['../group___port_creation.html#ga886364c39477e6170b570627298b8b69',1,'initializeUDPServerSocket(SOCKET *udpSocket, struct sockaddr_in *serverAddr, uint16_t port):&#160;network.c']]],
['initializewinsock_2',['initializeWinsock',['../group___port_creation.html#ga5ee93bf6ea9d1f37eedb43e05ebf0157',1,'initializeWinsock():&#160;network.c'],['../group___port_creation.html#ga5ee93bf6ea9d1f37eedb43e05ebf0157',1,'initializeWinsock():&#160;network.c']]]
['library_0',['Library',['../index.html#library',1,'']]]
];
3 changes: 1 addition & 2 deletions docs/docs/NetworkUtilities/html/search/all_7.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var searchData=
[
['library_0',['Library',['../index.html#dynamic-link-library',1,'Dynamic Link Library'],['../index.html#static-library',1,'Static Library']]],
['link_20library_1',['Dynamic Link Library',['../index.html#dynamic-link-library',1,'']]]
['messaging_0',['Messaging',['../group___messaging.html',1,'']]]
];
3 changes: 2 additions & 1 deletion docs/docs/NetworkUtilities/html/search/all_8.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var searchData=
[
['messaging_0',['Messaging',['../group___messaging.html',1,'']]]
['network_20utilities_0',['Network Utilities',['../index.html',1,'']]],
['note_20about_20gcc_1',['Note about gcc',['../index.html#note-about-gcc',1,'']]]
];
3 changes: 1 addition & 2 deletions docs/docs/NetworkUtilities/html/search/all_9.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var searchData=
[
['network_20utilities_0',['Network Utilities',['../index.html',1,'']]],
['note_20about_20gcc_1',['Note about gcc',['../index.html#note-about-gcc',1,'']]]
['port_20creation_0',['Port Creation',['../group___port_creation.html',1,'']]]
];
3 changes: 2 additions & 1 deletion docs/docs/NetworkUtilities/html/search/all_a.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions docs/docs/NetworkUtilities/html/search/all_b.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6f41e75

Please sign in to comment.