Questions and Answers
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.
- Does the
sockpp::tcp_socketensure 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? - Is there a way to get the local IP address through the library (could be it's not related to this library)
- Is there a way to resolve a domain name to an IP address?
Thanks in advance.
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...
- A
sockpp::tcp_socketjust wraps a TCP socket (SOCK_STREAM, family AF_INET). The delivery guarantees and behavior come from the stream itself. - 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.
- There's the
- DNS does this.
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.
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
- clone the repository
- build the library through CMake
- in your VS project, specify the include directory, library directory, and add the library name to link to. Be careful, because for windows you should also link to a system library (ws2_32.dll)
Closing as there hasn't been any activity on this in a while. Feel free to open new tickets with any other questions.