Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pkivolowitz/csc2510-network-code
Developed for Comp Org at Carthage College - demonstrates TCP client / server
https://github.com/pkivolowitz/csc2510-network-code
Last synced: about 1 month ago
JSON representation
Developed for Comp Org at Carthage College - demonstrates TCP client / server
- Host: GitHub
- URL: https://github.com/pkivolowitz/csc2510-network-code
- Owner: pkivolowitz
- License: mit
- Created: 2017-04-28T02:59:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-03T12:01:42.000Z (over 3 years ago)
- Last Synced: 2023-03-05T00:46:51.772Z (almost 2 years ago)
- Language: C++
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Carthage College Computer Organization Networking Demo
This code implements a multi-threaded server along with a client.
From the client, you can send strings which are printed on the server side.
Sending "quit" (no quotes) causes the thread on the other side to be closed.
This will cause the client to close as soon as it notices the connection to
the server has been lost.server options: -p port
client options: -p port -h server_ip_address# Framing
Framing of strings is accomplished be prepending the length of the string.
# There is a latent bug in this code
See if you can find it. Here is a hint:
#include <iostream>using namespace std;
int main()
{#if defined(_WIN32) && !defined(_WIN64)
cout << "x86 binary" << endl;
#elif defined(_WIN64)
cout << "x64 binary" << endl;
#endifcout << "sizeof(unsigned int): " << sizeof(unsigned int) << endl;
cout << "sizeof(size_t): " << sizeof(size_t) << endl;#if defined(_WIN32) || defined(_WIN64)
system("pause");
#endifreturn 0;
}