- 👋 Hi, I’m ✨@je-el//Jewel Maldonado✨
- 📚 I'm currently a Computer Science/Computer & Electrical Engineering Double Major at UAF.
- 👀 I’m interested in Web Dev & Design, Software Development, Data Science, & Embedded System Programming.
- 🌱 Currently I am learning advanced systems and algorithms
- 💞️ I’d love to connect and collaborate on anything hands-on including HTML, CSS, JavaScript, C, C++, and Python.
- 💡 Have an idea and want to collaborate? Reach me via email: [email protected]
cs321_lab03's Introduction
cs321_lab03's People
cs321_lab03's Issues
`clientSocket` not declared
Line 66 in 7f29262
There is an issue with calling anything with clientSocket
as clientSocket
has not been declared in the scope or globally. Unless declared within main.
It seems that sock
should be used here instead since its the variable holding the socket file descriptor.
See following errors inheriting this issue:
NewClient.c:66:19: error: use of undeclared identifier 'clientSocket'
int read = recv(clientSocket,data,1024,0);
^
NewClient.c:72:12: error: use of undeclared identifier 'clientSocket'
send (clientSocket, input, 1024, 0);
^
NewClient.c:74:18: error: use of undeclared identifier 'clientSocket'
read = recv(clientSocket,data,1024, 0);
^
Line 87 in 7f29262
valread
needs to be a pointer or function pointer to prevent this error on compilation
NewClient.c:87:23: error: called object type 'int' is not a function or function pointer
valread = read(sock , buffer, 1024);
~~~~^
the scanf
function in the client
function is reading only one word of input, to read a full line including whitespace, etc try using fgets
instead.
Line 74 in 7f29262
read
cannot be used here as a variable, this may be a mistake and needs to be renamed.
On Line 74 this read
variable has no relation to read()
function. It is simply used to store the return value of the recv()
function which reads data from the socket.
so rather try using something like:
int socketRead = recv(clientSocket,data,1024,0);
Assignment Task 5
- The process should not end only after one pass of message between server and client as it is now. Server will only stop if one of the clients sends ‘BYE’ message
Assignment Task 3
- Currently the server is accepting a client message (request) and sending a response message to the same client. In your new version, the server should forward the accepted message from one client to the other client.
Assignment Task 1
- In the current version there is only one client. But you must create two different clients.
Assignment Task 4
- The server should work properly only when two clients are up and connecting to it. If there is only one client connecting to the server then, the server will send a message complaining “only one client is up”
Assignment Task 8
- You may need to send the client process pids to the server to establish the connection
Assignment Task 7
- For the sake of simplicity, assume that both your client and servers are on the same machine i.e. localhost (127.0.0.1)
Assignment Task 6
- The server process should be designed in such a way so that it cannot be aborted by hitting ctrl-c on that terminal
Assignment Task 2
- Currently the messages are hardcoded in the program. But your code must read the client messages from the user.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.