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.
Fork of MTS-Socket by
Endpoint.h
00001 #ifndef ENDPOINT_H 00002 #define ENDPOINT_H 00003 00004 class UDPSocket; 00005 00006 /** 00007 IP Endpoint (address, port) 00008 */ 00009 class Endpoint { 00010 friend class UDPSocket; 00011 00012 public: 00013 /** IP Endpoint (address, port) 00014 */ 00015 Endpoint(void); 00016 00017 ~Endpoint(void); 00018 00019 /** Reset the address of this endpoint 00020 */ 00021 void reset_address(void); 00022 00023 /** Set the address of this endpoint 00024 \param host The endpoint address (it can either be an IP Address or a hostname that will be resolved with DNS). 00025 \param port The endpoint port 00026 \return 0 on success, -1 on failure (when an hostname cannot be resolved by DNS). 00027 */ 00028 int set_address(const char* host, const int port); 00029 00030 /** Get the IP address of this endpoint 00031 \return The IP address of this endpoint. 00032 */ 00033 char* get_address(void); 00034 00035 /** Get the port of this endpoint 00036 \return The port of this endpoint 00037 */ 00038 int get_port(void); 00039 00040 protected: 00041 char _ipAddress[128]; 00042 int _port; 00043 }; 00044 00045 #endif
Generated on Wed Jul 13 2022 10:29:47 by
