ap
Dependencies: DnsQuery
Dependents: WizFi310_TCP_Echo_Server_Example
Fork of NetworkSocketAPI by
UDPSocket.h@43:09ea32f2eb54, 2016-02-24 (annotated)
- Committer:
- Christopher Haster
- Date:
- Wed Feb 24 22:04:19 2016 -0600
- Branch:
- api-changes
- Revision:
- 43:09ea32f2eb54
- Parent:
- 28:163fbe3263f4
- Child:
- 57:3c873fab4207
Responded to feedback in API decisions
- Removed small .cpp files
- Added null _iface checks
- Matched mbed coding standard
- Removed setTimeout/getTimeout
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Christopher Haster |
21:35ed15069189 | 1 | /* UDPSocket |
Christopher Haster |
21:35ed15069189 | 2 | * Copyright (c) 2015 ARM Limited |
Christopher Haster |
21:35ed15069189 | 3 | * |
Christopher Haster |
21:35ed15069189 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Christopher Haster |
21:35ed15069189 | 5 | * you may not use this file except in compliance with the License. |
Christopher Haster |
21:35ed15069189 | 6 | * You may obtain a copy of the License at |
Christopher Haster |
21:35ed15069189 | 7 | * |
Christopher Haster |
21:35ed15069189 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Christopher Haster |
21:35ed15069189 | 9 | * |
Christopher Haster |
21:35ed15069189 | 10 | * Unless required by applicable law or agreed to in writing, software |
Christopher Haster |
21:35ed15069189 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
Christopher Haster |
21:35ed15069189 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Christopher Haster |
21:35ed15069189 | 13 | * See the License for the specific language governing permissions and |
Christopher Haster |
21:35ed15069189 | 14 | * limitations under the License. |
Christopher Haster |
21:35ed15069189 | 15 | */ |
Christopher Haster |
21:35ed15069189 | 16 | |
Christopher Haster |
21:35ed15069189 | 17 | #ifndef UDP_SOCKET_H |
Christopher Haster |
21:35ed15069189 | 18 | #define UDP_SOCKET_H |
Christopher Haster |
21:35ed15069189 | 19 | |
Christopher Haster |
25:ed7b2a52e8ac | 20 | #include "Socket.h" |
Christopher Haster |
21:35ed15069189 | 21 | |
Christopher Haster |
21:35ed15069189 | 22 | /** UDPSocket class |
Christopher Haster |
21:35ed15069189 | 23 | * API for handling UDP sockets. The implementation is determined |
Christopher Haster |
21:35ed15069189 | 24 | * by the interface passed during construction. |
Christopher Haster |
21:35ed15069189 | 25 | */ |
Christopher Haster |
25:ed7b2a52e8ac | 26 | class UDPSocket : public Socket |
Christopher Haster |
21:35ed15069189 | 27 | { |
Christopher Haster |
21:35ed15069189 | 28 | public: |
Christopher Haster |
21:35ed15069189 | 29 | /** Create a socket using the specified network interface |
Christopher Haster |
27:d7ed39727306 | 30 | * No network operations are performed until the socket is actually used |
Christopher Haster |
21:35ed15069189 | 31 | * @param iface The network interface to use |
Christopher Haster |
24:a5e959bdd2dd | 32 | * @param ip Optional URL to connect to, copied internally |
Christopher Haster |
21:35ed15069189 | 33 | * @param port Optional port to connect to |
Christopher Haster |
21:35ed15069189 | 34 | */ |
Christopher Haster |
43:09ea32f2eb54 | 35 | UDPSocket(NetworkInterface *iface) |
Christopher Haster |
43:09ea32f2eb54 | 36 | : Socket(iface, SOCK_UDP) |
Christopher Haster |
43:09ea32f2eb54 | 37 | { |
Christopher Haster |
43:09ea32f2eb54 | 38 | } |
Christopher Haster |
21:35ed15069189 | 39 | }; |
Christopher Haster |
21:35ed15069189 | 40 | |
Christopher Haster |
21:35ed15069189 | 41 | #endif |