1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_UDP_UDP_SOCKET_H_
6 #define NET_UDP_UDP_SOCKET_H_
8 #include "build/build_config.h"
11 #include "net/udp/udp_socket_win.h"
12 #elif defined(OS_POSIX)
13 #include "net/udp/udp_socket_libevent.h"
19 // Accessor API for a UDP socket in either client or server form.
22 // In this case, we're connecting to a specific server, so the client will
24 // Connect(address) // Connect to a UDP server
25 // Read/Write // Reads/Writes all go to a single destination
28 // In this case, we want to read/write to many clients which are connecting
29 // to this server. First the server 'binds' to an addres, then we read from
30 // clients and write responses to them.
32 // Bind(address/port) // Binds to port for reading from clients
33 // RecvFrom/SendTo // Each read can come from a different client
34 // // Writes need to be directed to a specific
37 typedef UDPSocketWin UDPSocket
;
38 #elif defined(OS_POSIX)
39 typedef UDPSocketLibevent UDPSocket
;
44 #endif // NET_UDP_UDP_SOCKET_H_