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.
4
5#include "net/udp/udp_server_socket.h"
6
7namespace net {
8
9UDPServerSocket::UDPServerSocket(net::NetLog* net_log,
10                                 const net::NetLog::Source& source)
11    : socket_(net_log, source) {
12}
13
14UDPServerSocket::~UDPServerSocket() {
15}
16
17int UDPServerSocket::Listen(const IPEndPoint& address) {
18  return socket_.Bind(address);
19}
20
21int UDPServerSocket::RecvFrom(IOBuffer* buf,
22                              int buf_len,
23                              IPEndPoint* address,
24                              CompletionCallback* callback) {
25  return socket_.RecvFrom(buf, buf_len, address, callback);
26}
27
28int UDPServerSocket::SendTo(IOBuffer* buf,
29                            int buf_len,
30                            const IPEndPoint& address,
31                            CompletionCallback* callback) {
32  return socket_.SendTo(buf, buf_len, address, callback);
33}
34
35void UDPServerSocket::Close() {
36  socket_.Close();
37}
38
39int UDPServerSocket::GetPeerAddress(IPEndPoint* address) const {
40  return socket_.GetPeerAddress(address);
41}
42
43int UDPServerSocket::GetLocalAddress(IPEndPoint* address) const {
44  return socket_.GetLocalAddress(address);
45}
46
47
48}  // namespace net
49