How make connection between URL and C code? [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 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.

Related

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)

Packet analyzer in 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 8 years ago.
Improve this question
I need to capture packets which are coming from interface (say eth0) and need to print those packet details (same as wireshark) through C language. Packet can be any general packet. is there any way to achieve this ??
(I don't want to use any application like wireshark for this purpose)
OS:Centos
Try having a look at libpcap. http://www.tcpdump.org/ I believe it will do what you want.

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.

How to download a file using winsock or wininet [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 9 years ago.
Improve this question
I could not find any code samples using Google. Could someone please show me how to do it? I think we need to use winsock or wininet.
You didn't search that much...
recv function: http://msdn.microsoft.com/en-us/library/windows/desktop/ms740121(v=vs.85).aspx

Resources