fpagliughi / sockpp

Modern C++ socket library.
BSD 3-Clause "New" or "Revised" License
782 stars 126 forks source link

Questions and Answers #47

Closed arsdever closed 1 year ago

arsdever commented 4 years ago

Hi there. I found useful to have such a place to get answers to some questions related to the library. So, hopefully, this does the job.

At least I have a little list of questions that I want to ask you before continuing to work on my project.

  1. Does the sockpp::tcp_socket ensure that the packets will be transferred for 100% (I mean if there is not a full connection lost, but some packets were dropped) and in the correct order?
  2. Is there a way to get the local IP address through the library (could be it's not related to this library)
  3. Is there a way to resolve a domain name to an IP address?

Thanks in advance.

fpagliughi commented 4 years ago

The sockpp library is just a very thin layer around Berkeley sockets and the Microsoft WinSock library in an attempt to make them easy to use in Modern C++. So it doesn't add anything to raw network programming - it just tries to make it easier to manage. So most of these questions are general networking questions with answers out on the ether better than I can give.

So the documentation for this library is pretty light, since a familiarity with the socket library is assumed.

If there's anything specific that you can do in the C socket library that you can't do in sockpp, raise an issue or send a PR, and we can look to add it. But again, this is just meant to be a raw and efficient wrapper around the underlying library.

So...

  1. A sockpp::tcp_socket just wraps a TCP socket (SOCK_STREAM, family AF_INET). The delivery guarantees and behavior come from the stream itself.
  2. I'm not sure which you mean.
    • There's the address() for a currently connected socket, which you can query easily.
    • There can be several network adapters in a host, each bound to several addresses.
    • The host can be behind a router, which has a WAN address to the rest of the world.
  3. DNS does this.
SpencerTinnin commented 3 years ago

How exactly do I add this to a visual studio project? I'm sorry for asking such a basic question, but I cannot find the answer anywhere despite how simple of a question it seems.

arsdever commented 3 years ago

It'd been a while I used it by adding it to the VS project. If I recall it correctly, the procedure is the following

fpagliughi commented 1 year ago

Closing as there hasn't been any activity on this in a while. Feel free to open new tickets with any other questions.