void ThreadRPCServer3(void* parg);
-static inline unsigned short GetDefaultRPCPort()
+static inline uint16_t GetDefaultRPCPort()
{
return GetBoolArg("-testnet", false) ? 18344 : 8344;
}
struct ircaddr
{
struct in_addr ip;
- unsigned short port;
+ uint16_t port;
};
#pragma pack(pop)
struct stun_addr {
unsigned char unused;
unsigned char family;
- unsigned short port;
+ uint16_t port;
unsigned int addr;
} __attribute__((packed));
#else
struct stun_addr {
unsigned char unused;
unsigned char family;
- unsigned short port;
+ uint16_t port;
unsigned int addr;
};
#pragma pack(pop)
vOneShots.push_back(strDest);
}
-unsigned short GetListenPort()
+uint16_t GetListenPort()
{
- return (unsigned short)(GetArg("-port", GetDefaultPort()));
+ return static_cast<uint16_t>(GetArg("-port", GetDefaultPort()));
}
void CNode::PushGetBlocks(CBlockIndex* pindexBegin, uint256 hashEnd)
CNode* ConnectNode(CAddress addrConnect, const char *strDest = NULL, int64_t nTimeout=0);
bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false);
void MapPort();
-unsigned short GetListenPort();
+uint16_t GetListenPort();
bool BindListenPort(const CService &bindAddr, string& strError=REF(string()));
void StartNode(void* parg);
bool StopNode();
*this = ip;
}
-unsigned short CService::GetPort() const
+uint16_t CService::GetPort() const
{
return port;
}
return ToStringIPPort();
}
-void CService::SetPort(unsigned short portIn)
+void CService::SetPort(uint16_t portIn)
{
port = portIn;
}
class CService : public CNetAddr
{
protected:
- unsigned short port; // host order
+ uint16_t port; // host order
public:
CService();
explicit CService(const std::string& strIpPort, bool fAllowLookup = false);
void Init();
void SetPort(uint16_t portIn);
- unsigned short GetPort() const;
+ uint16_t GetPort() const;
bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const;
bool SetSockAddr(const struct sockaddr* paddr);
friend bool operator==(const CService& a, const CService& b);
(
CService* pthis = const_cast<CService*>(this);
READWRITE(FLATDATA(ip));
- unsigned short portN = htons(port);
+ uint16_t portN = htons(port);
READWRITE(portN);
if (fRead)
pthis->port = ntohs(portN);
#include "uint256.h"
extern bool fTestNet;
-inline unsigned short GetDefaultPort()
+inline uint16_t GetDefaultPort()
{
- return static_cast<unsigned short>(fTestNet ? 17777 : 7777);
+ return static_cast<uint16_t>(fTestNet ? 17777 : 7777);
}
extern uint8_t pchMessageStart[4];