Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: HelloWorld ServoInterfaceBoardExample1 4180_Lab4
Diff: if/net/host.h
- Revision:
- 8:93fa3cfc0219
- Parent:
- 0:632c9925f013
diff -r 534fa46ad8c5 -r 93fa3cfc0219 if/net/host.h
--- a/if/net/host.h Wed Jul 28 11:55:27 2010 +0000
+++ b/if/net/host.h Wed Jul 28 12:45:32 2010 +0000
@@ -30,13 +30,23 @@
#include "netdnsrequest.h"
#include <string.h>
+///Host information container
+/**
+This class is a container for data relative to a connection:
+- IP Address
+- Port number
+- Host Name
+*/
class Host
{
public:
+ ///Initiliazes host with null values
Host() : m_ip(0,0,0,0), m_port(0), m_name(NULL)
{
}
+
+ ///Initializes host
Host(const IpAddr& ip, const int& port, const char* name="" ) : m_ip(ip), m_port(port), m_name(NULL)
{
setName(name);
@@ -50,31 +60,37 @@
}
}
+ ///Returns IP address
const IpAddr& getIp() const
{
return m_ip;
}
+ ///Returns port number
const int& getPort() const
{
return m_port;
}
+ ///Returns host name
const char* getName() const
{
return m_name;
}
+ ///Sets IP address
void setIp(const IpAddr& ip)
{
m_ip = ip;
}
+ ///Sets port number
void setPort(int port)
{
m_port = port;
}
+ ///Sets host name
void setName(const char* name)
{
if(m_name)