What is a good indicator of a request sent over a socket? [closed] - c

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am writing some codeql for web servers like apache and nginx. I have done some research and found that a good indicator of a request is ntohs or ntohl because the the data that is sent over a socket needs to be converted from network byte order to host byte order. Are there any other indicators which I should use for web servers?

"Are there any other indicators which I should use for web servers?"
Your post includes the C tag, so besides the byte order functions you include the select() function should be at least included in the conversation for its message traffic handling capabilities. It is available for both Linux and windows environments, as indicated by following links.
The select(). call is commonly used to manage socket traffic. Read about the concept here. (Link includes tutorial content with code snippets for illustration.)

Related

Is socket programming what I need? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
So I'm developing a 2d game using sdl1.2 on linux as a part of a college project and I need the player to be able to submit his score to know his ranking against other players who played the game aswell and I was wondering what am I going to need in order to achieve this with C, is socket programming the answer?
Thank you.
Yes, if your concern is about the communication, then socket is the only way, of course there are easy to use wrappers around socket, like zeromq etc.
The server would create a server socket and listens on it, and each client will connect to this server and then send the scores and any other data necessary to the server.
For data persistent, you can use embedded database like SQLite or leveldb etc.

a server client application using TCP in C in linux environment, [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i have created a server client application using TCP in C in linux environment,and it is working very well.
I wish to improve the application by including a cryptographic algorithm into it so that the server just gets to know about who has logged in and out of the server but not about the information shared between the clients.
Any suggestions for algorithm that i should employ in my project to achieve the desired result.
I am currently looking into MD5 algorithm.
As far as I understand you want to encrypt/decrypt messages between users. If so MD5 won't do it as it is just a hash function.
https://en.wikipedia.org/wiki/MD5
Probably the best algorithm to do so would be AES:
https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
There are many implementation (including in C) on the web so you can literally copy-paste the code (mind the license ;) ).

Can you suggest any library to connect to internet with C? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I've been learning C for the past few weeks. I don't understand yet how to connect to internet with C. I've programmed in Python and I used the urllib in the Python stdlib to connect to internet. Is there any library that can help me connect to internet ?
Libcurl is a popular choice for making HTTP requests, which I assume is what you're interested in doing.
In pure C wirthout any library it is not possible as network access depends on the specific platform. However, the socket API is some kind of standard library which permits sending data via TCP/IP. The necessary HTTP handling, if desired, would have to be implemented on top of that.

For sockets, which side does the majority of the work? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
For sockets, which side does the majority of the work?
I've been given this question to answer and don't really understand what it means. I've browsed through the web to find answers. However, nothing. So can somebody guide me to what it's actually asking? What it means?
Thanks!
Client should know the details of the server it connects to. The connect call is instantaneous.
But on the other hand the server should be continuously listening to a port for any incoming connections in the accept call.
So technically a server would take more of the processor time.
Once the connection is established the client and server pretty much has the same work in terms of sending and receiving messages.

How NTP protocol works? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I try to find ant NTP documentation for "dummies", I don't understand how NTP works. I need to write an NTP client which should just print current local time. What should I send to the server? What will I receive?
If you want to implement your own client then you need the RFC 5905 - Network Time Protocol Version 4 which specifies the protocol and algorithms of NTP. This document describes exactly what you should send to the server and what you will receive.

Resources