]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/net/lwip/Socket/Endpoint.h
1 /* Copyright (C) 2012 mbed.org, MIT License
3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7 * furnished to do so, subject to the following conditions:
9 * The above copyright notice and this permission notice shall be included in all copies or
10 * substantial portions of the Software.
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 IP Endpoint (address, port)
27 friend class UDPSocket
;
30 /** IP Endpoint (address, port)
36 /** Reset the address of this endpoint
38 void reset_address(void);
40 /** Set the address of this endpoint
41 \param host The endpoint address (it can either be an IP Address or a hostname that will be resolved with DNS).
42 \param port The endpoint port
43 \return 0 on success, -1 on failure (when an hostname cannot be resolved by DNS).
45 int set_address(const char* host
, const int port
);
47 /** Get the IP address of this endpoint
48 \return The IP address of this endpoint.
50 char* get_address(void);
52 /** Get the port of this endpoint
53 \return The port of this endpoint
59 struct sockaddr_in _remoteHost
;