• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_client_socket.h"
6 
7 #include "net/base/net_log.h"
8 
9 namespace net {
10 
UDPClientSocket(DatagramSocket::BindType bind_type,const RandIntCallback & rand_int_cb,net::NetLog * net_log,const net::NetLog::Source & source)11 UDPClientSocket::UDPClientSocket(DatagramSocket::BindType bind_type,
12                                  const RandIntCallback& rand_int_cb,
13                                  net::NetLog* net_log,
14                                  const net::NetLog::Source& source)
15     : socket_(bind_type, rand_int_cb, net_log, source) {
16 }
17 
~UDPClientSocket()18 UDPClientSocket::~UDPClientSocket() {
19 }
20 
Connect(const IPEndPoint & address)21 int UDPClientSocket::Connect(const IPEndPoint& address) {
22   return socket_.Connect(address);
23 }
24 
Read(IOBuffer * buf,int buf_len,const CompletionCallback & callback)25 int UDPClientSocket::Read(IOBuffer* buf,
26                           int buf_len,
27                           const CompletionCallback& callback) {
28   return socket_.Read(buf, buf_len, callback);
29 }
30 
Write(IOBuffer * buf,int buf_len,const CompletionCallback & callback)31 int UDPClientSocket::Write(IOBuffer* buf,
32                           int buf_len,
33                           const CompletionCallback& callback) {
34   return socket_.Write(buf, buf_len, callback);
35 }
36 
Close()37 void UDPClientSocket::Close() {
38   socket_.Close();
39 }
40 
GetPeerAddress(IPEndPoint * address) const41 int UDPClientSocket::GetPeerAddress(IPEndPoint* address) const {
42   return socket_.GetPeerAddress(address);
43 }
44 
GetLocalAddress(IPEndPoint * address) const45 int UDPClientSocket::GetLocalAddress(IPEndPoint* address) const {
46   return socket_.GetLocalAddress(address);
47 }
48 
SetReceiveBufferSize(int32 size)49 int UDPClientSocket::SetReceiveBufferSize(int32 size) {
50   return socket_.SetReceiveBufferSize(size);
51 }
52 
SetSendBufferSize(int32 size)53 int UDPClientSocket::SetSendBufferSize(int32 size) {
54   return socket_.SetSendBufferSize(size);
55 }
56 
NetLog() const57 const BoundNetLog& UDPClientSocket::NetLog() const {
58   return socket_.NetLog();
59 }
60 
61 }  // namespace net
62