C++ socket programming

Posts 1–6 of 6 · Page 1 of 1
C++ socket programming
So I've been trying to grasp the concept of socket programming in C++, and I've read numerious tutorial online etc, but I'm finding it really hard to understand how it works.

If anyone has any experience with this, would you mind explaining how it works? :-)

(If it helps, I'm trying to use it to create an IRC bot of some sort)
meh, IDK. It is not that hard on C++. But in my opinion try on C#, the syntax is almost the same as in C++. But C# is .NET
A socket is a your delivery man .

You give him a message (data), he delivers it to your target for you .

With UDP (urban delivery), you're using postal mail, and it can get lost and you won't know about it.
With TCP, its typical company stuff. You pay more (higher latency and lower throughput), but you're guaranteed that the message is delivered, or, if the delivery man is killed on the way, you're told about it.

Only one recipient (listener) per socket, but many people from the same house (computer) can send from it.

And yeah, that's pretty much all sockets are.
Quote Originally Posted by freedompeace View Post
A socket is a your delivery man .

You give him a message (data), he delivers it to your target for you .

With UDP (urban delivery), you're using postal mail, and it can get lost and you won't know about it.
With TCP, its typical company stuff. You pay more (higher latency and lower throughput), but you're guaranteed that the message is delivered, or, if the delivery man is killed on the way, you're told about it.

Only one recipient (listener) per socket, but many people from the same house (computer) can send from it.

And yeah, that's pretty much all sockets are.
Sorry, I should've expressed myself better. I know what they ARE, I'm just having trouble getting them to work in C++
Quote Originally Posted by Revultra View Post
Sorry, I should've expressed myself better. I know what they ARE, I'm just having trouble getting them to work in C++
Are you trying to implement sockets in Windows, Linux or UNIX? And are you using any helper libs?
Quote Originally Posted by freedompeace View Post


Are you trying to implement sockets in Windows, Linux or UNIX? And are you using any helper libs?
Windows,
And I'm only using the standard library (winsock.h)
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us