For sockets, which side does the majority of the work? [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 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.

Related

How make connection between URL and C code? [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 3 years ago.
Improve this question
I have question about connection to Redis server via URL. How can I do that in C code?
I tried to find something about that but it seems every one use for connection IP and port.
Without more details it's hard to give a detailed answer. But your question iplies that you know how to connect by ip, and if you have an url, it's easy to get the ip from dns. You only need to build a wrapper of some kind.
return_type myRedisWrapper(const char* url) {
char ip[16];
extractIpFromUrl(url, ip);
return redisLibFunction(ip);
};
So you only have to implement extractIpFromUrl which should be fairly simple.

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.

Create an IRC Server [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 need to develop an IRC server, I don't have any idea how to do it. The language that I should use is C and maybe SQL if it's needed.
Could you provide some insight and help me understand from where I should start?
Note: I have looked for many documentation on Web but nothing clear.
look at my old IRC bot: https://github.com/kala13x/derpina (IRC Client)
Every line is commented and documented and I think it will be easy to understand for you.
And look at this too: https://github.com/bloodead/IRC (IRC Server)

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.

How to implement a simple telnet client in C to send command to server [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 want to use telnet to send shell command or execute shell scripts on server automatically,
any one have done such problem? can you share your experience?
It's all about socket communication. You need to know how socket works. Then, implement Telnet protocol by yourself.
If you don't want to implement your own telnet libraries. You might download putty source and see if you could leverage from it.

Resources