#ifndef NET_QUIC_QUIC_SOCKET_ADDRESS_CODER_H_
#define NET_QUIC_QUIC_SOCKET_ADDRESS_CODER_H_
#include <string>
#include "base/basictypes.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_export.h"
namespace net {
class NET_EXPORT_PRIVATE QuicSocketAddressCoder {
public:
QuicSocketAddressCoder();
explicit QuicSocketAddressCoder(const IPEndPoint& address);
~QuicSocketAddressCoder();
std::string Encode() const;
bool Decode(const char* data, size_t length);
IPAddressNumber ip() const {
return address_.address();
}
uint16 port() const {
return address_.port();
}
private:
IPEndPoint address_;
DISALLOW_COPY_AND_ASSIGN(QuicSocketAddressCoder);
};
}
#endif