Files
2024-09-23 12:00:04 -04:00

70 lines
1.9 KiB
C++

#pragma once
/*
* Copyright Onix Solutions Limited [OnixS]. All rights reserved.
*
* This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
* and international copyright treaties.
*
* Access to and use of the software is governed by the terms of the applicable OnixS Software
* Services Agreement (the Agreement) and Customer end user license agreements granting
* a non-assignable, non-transferable and non-exclusive license to use the software
* for it's own data processing purposes under the terms defined in the Agreement.
*
* Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
* of this source code or associated reference material to any other location for further reproduction
* or redistribution, and any amendments to this copyright notice, are expressly prohibited.
*
* Any reproduction or redistribution for sale or hiring of the Software not in accordance with
* the terms of the Agreement is a violation of copyright law.
*/
#if defined (_WIN32) // Windows platform.
#if !defined (STRICT)
#define STRICT
#endif
#include <Windows.h>
#if defined (WIN32_LEAN_AND_MEAN)
#include <winsock2.h>
#endif
#endif
#include <vector>
namespace OnixS {
namespace Sockets {
/// Type alias for byte.
typedef unsigned char Byte;
/// Sequence of bytes.
typedef std::vector<Byte> Bytes;
#if defined (_WIN32)
/// Type alias for socket handle
typedef SOCKET Handle;
#else
/// Type alias for socket handle
typedef int Handle;
#endif
/// Socket option of the SOL_SOCKET level
struct SocketOption {
SocketOption()
: optname(0), optval(), optlen(0) {}
SocketOption(int optionName, void * optionValue, int optionLength)
: optname(optionName), optval(optionValue), optlen(optionLength) {}
int optname;
const void * optval;
int optlen;
};
/// Storage type of socket options
typedef std::vector<SocketOption> SocketOptions;
}
}