Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ network programming

Hey, I would like to expand my knowledge in C++, so the first thing I'm taking on is network programming.

I want to make an IRC bot(which hopefully will teach me about socket programming and networking topics), but I have no idea where to start. If anyone could explain to me how IRC bots work and how to make them, and direct me to some learning resources, that would be really great. Simple snippets as well would be awesome...

Thanks!

edit:

forgot to mention that I use ubuntu, so the windows way is not an option

like image 590
Lockhead Avatar asked Apr 24 '11 21:04

Lockhead


People also ask

Is C good for network programming?

Yes. C is a simple imperative programming language.

What is networking in C programming?

Network programming enables processes to communicate with each other over a computer network, but it is a complex task that requires programming with multiple libraries and protocols. With its support for third-party libraries and structured documentation, C is an ideal language to write network programs.

What is socket programming in C?

Socket programming is a way of connecting two nodes on a network to communicate with each other. One socket(node) listens on a particular port at an IP, while the other socket reaches out to the other to form a connection. The server forms the listener socket while the client reaches out to the server.

Which language is best for socket programming?

Java and C#/C++ are the best languages for socket Programming.


1 Answers

To understand sockets and use them right, you need The Sockets Bible:

W. Richard Stevens, Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)

You absolutely must have this book before you sit down to write a line of sockets code. Don't leave home without it. Really. Starting around $35 used at Amazon.

EDIT: The OP asked about other volumes. Here are two others:

  W. Richard Stevens, UNIX Network Programming, Volume 2: Interprocess Communications (2nd Edition)
  W. Richard Stevens, TCP/IP Illustrated, Vol. 1: The Protocols

They are of Stevens's usual and expected superb quality. I don't know what his plans were for integrating all these books,

like image 135
Pete Wilson Avatar answered Sep 17 '22 15:09

Pete Wilson