mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
Make many more utility classes/headers public. (#76)
Moving these headers from src to include enables other libraries to use the functionality provided. * tcpsockets * atomic_static * raw_istream * timestamp * SafeThread * Base64 * LEB128 * ConcurrentQueue The classes have been moved into the wpi namespace as they're generic.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "TCPStream.h"
|
||||
#include "tcpsockets/TCPStream.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <WinSock2.h>
|
||||
@@ -31,13 +31,15 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
TCPStream::TCPStream(int sd, struct sockaddr_in* address) : m_sd(sd) {
|
||||
using namespace wpi;
|
||||
|
||||
TCPStream::TCPStream(int sd, sockaddr_in* address) : m_sd(sd) {
|
||||
char ip[50];
|
||||
#ifdef _WIN32
|
||||
unsigned long size = sizeof(ip) - 1;
|
||||
WSAAddressToString((struct sockaddr*)address, sizeof sockaddr_in, nullptr, ip, &size);
|
||||
WSAAddressToString((sockaddr*)address, sizeof sockaddr_in, nullptr, ip, &size);
|
||||
#else
|
||||
inet_ntop(PF_INET, (struct in_addr*)&(address->sin_addr.s_addr), ip,
|
||||
inet_ntop(PF_INET, (in_addr*)&(address->sin_addr.s_addr), ip,
|
||||
sizeof(ip) - 1);
|
||||
#endif
|
||||
m_peerIP = ip;
|
||||
|
||||
Reference in New Issue
Block a user