blob: 6fdc2c4e0f2e56fa0d9c6aea38a3b4d712f4d2c7 [file] [log] [blame]
[email protected]a2798d92011-03-02 22:56:181// 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#ifndef NET_SOCKET_UDP_SERVER_SOCKET_H_
6#define NET_SOCKET_UDP_SERVER_SOCKET_H_
7#pragma once
8
9#include "net/base/completion_callback.h"
10#include "net/udp/datagram_server_socket.h"
11#include "net/udp/udp_socket.h"
12
13namespace net {
14
[email protected]43d4a0262011-03-09 19:26:0415class IPEndPoint;
[email protected]a2798d92011-03-02 22:56:1816class BoundNetLog;
17
18// A client socket that uses UDP as the transport layer.
[email protected]172da1b2011-08-12 15:52:2619class NET_EXPORT UDPServerSocket : public DatagramServerSocket {
[email protected]a2798d92011-03-02 22:56:1820 public:
21 UDPServerSocket(net::NetLog* net_log,
22 const net::NetLog::Source& source);
23 virtual ~UDPServerSocket();
24
25 // Implement DatagramServerSocket:
[email protected]43d4a0262011-03-09 19:26:0426 virtual int Listen(const IPEndPoint& address);
[email protected]a2798d92011-03-02 22:56:1827 virtual int RecvFrom(IOBuffer* buf,
28 int buf_len,
[email protected]43d4a0262011-03-09 19:26:0429 IPEndPoint* address,
[email protected]a2798d92011-03-02 22:56:1830 CompletionCallback* callback);
31 virtual int SendTo(IOBuffer* buf,
32 int buf_len,
[email protected]43d4a0262011-03-09 19:26:0433 const IPEndPoint& address,
[email protected]a2798d92011-03-02 22:56:1834 CompletionCallback* callback);
35 virtual void Close();
[email protected]43d4a0262011-03-09 19:26:0436 virtual int GetPeerAddress(IPEndPoint* address) const;
37 virtual int GetLocalAddress(IPEndPoint* address) const;
[email protected]eaf10dc2011-07-18 21:47:3538 virtual const BoundNetLog& NetLog() const;
[email protected]a2798d92011-03-02 22:56:1839
40 private:
41 UDPSocket socket_;
42 DISALLOW_COPY_AND_ASSIGN(UDPServerSocket);
43};
44
45} // namespace net
46
47#endif // NET_SOCKET_UDP_SERVER_SOCKET_H_