Searched refs:Socket (Results 1 - 12 of 12) sorted by relevance
/system/core/fastboot/ |
H A D | socket.h | 46 // Socket interface to be implemented for each platform. 47 class Socket { class 58 static std::unique_ptr<Socket> NewClient(Protocol protocol, const std::string& hostname, 65 static std::unique_ptr<Socket> NewServer(Protocol protocol, int port); 68 virtual ~Socket(); 98 // Accepts an incoming TCP connection. No effect for UDP sockets. Returns a new Socket 100 virtual std::unique_ptr<Socket> Accept() { return nullptr; } 102 // Returns the local port the Socket is bound to or -1 on error. 107 explicit Socket(cutils_socket_t sock); 126 DISALLOW_COPY_AND_ASSIGN(Socket); [all...] |
H A D | socket_mock.h | 40 // A mock Socket implementation to be used for testing. Tests can set expectations for messages 54 class SocketMock : public Socket { 63 virtual std::unique_ptr<Socket> Accept(); 80 // Adds a Socket to return from Accept(). 81 void AddAccept(std::unique_ptr<Socket> sock); 88 std::unique_ptr<Socket> _sock); 93 std::unique_ptr<Socket> sock;
|
H A D | socket_test.cpp | 35 bool MakeConnectedSockets(Socket::Protocol protocol, std::unique_ptr<Socket>* server, 36 std::unique_ptr<Socket>* client, 38 *server = Socket::NewServer(protocol, 0); 44 *client = Socket::NewClient(protocol, hostname, (*server)->GetLocalPort(), nullptr); 51 if (protocol == Socket::Protocol::kTcp) { 62 // Sends a string over a Socket. Returns true if the full string (without terminating char) 64 static bool SendString(Socket* sock, const std::string& message) { 68 // Receives a string from a Socket. Returns true if the full string (without terminating char) 70 static bool ReceiveString(Socket* soc [all...] |
H A D | socket.cpp | 34 Socket::Socket(cutils_socket_t sock) : sock_(sock) {} function in class:Socket 36 Socket::~Socket() { 40 int Socket::Close() { 51 ssize_t Socket::ReceiveAll(void* data, size_t length, int timeout_ms) { 69 int Socket::GetLocalPort() { 77 bool Socket::WaitForRecv(int timeout_ms) { 107 // Implements the Socket interface for UDP. 108 class UdpSocket : public Socket { [all...] |
H A D | tcp.cpp | 59 static std::unique_ptr<TcpTransport> NewTransport(std::unique_ptr<Socket> socket, 69 explicit TcpTransport(std::unique_ptr<Socket> sock) : socket_(std::move(sock)) {} 75 std::unique_ptr<Socket> socket_; 81 std::unique_ptr<TcpTransport> TcpTransport::NewTransport(std::unique_ptr<Socket> socket, 98 Socket::GetErrorMessage().c_str()); 107 Socket::GetErrorMessage().c_str()); 182 return internal::Connect(Socket::NewClient(Socket::Protocol::kTcp, hostname, port, error), 188 std::unique_ptr<Transport> Connect(std::unique_ptr<Socket> sock, std::string* error) { 190 // If Socket creatio [all...] |
H A D | tcp.h | 51 // Creates a TCP Transport object but using a given Socket instead of connecting to a hostname. 53 std::unique_ptr<Transport> Connect(std::unique_ptr<Socket> sock, std::string* error);
|
H A D | socket_mock.cpp | 33 SocketMock::SocketMock() : Socket(INVALID_SOCKET) {} 109 std::unique_ptr<Socket> SocketMock::Accept() { 120 std::unique_ptr<Socket> sock = std::move(events_.front().sock); 145 void SocketMock::AddAccept(std::unique_ptr<Socket> sock) { 150 std::unique_ptr<Socket> _sock)
|
H A D | udp.cpp | 105 static std::unique_ptr<UdpTransport> NewTransport(std::unique_ptr<Socket> socket, 114 explicit UdpTransport(std::unique_ptr<Socket> socket) : socket_(std::move(socket)) {} 133 std::unique_ptr<Socket> socket_; 141 std::unique_ptr<UdpTransport> UdpTransport::NewTransport(std::unique_ptr<Socket> socket, 261 *error = Socket::GetErrorMessage(); 273 *error = Socket::GetErrorMessage(); 374 return internal::Connect(Socket::NewClient(Socket::Protocol::kUdp, hostname, port, error), 380 std::unique_ptr<Transport> Connect(std::unique_ptr<Socket> sock, std::string* error) { 382 // If Socket creatio [all...] |
H A D | udp.h | 73 // Creates a UDP Transport object using a given Socket. Used for unit tests to create a Transport 75 std::unique_ptr<Transport> Connect(std::unique_ptr<Socket> sock, std::string* error);
|
H A D | tcp_test.cpp | 103 transport_ = tcp::internal::Connect(std::unique_ptr<Socket>(mock_), &error);
|
H A D | fastboot.cpp | 252 Socket::Protocol protocol = Socket::Protocol::kTcp; 259 protocol = Socket::Protocol::kTcp; 263 protocol = Socket::Protocol::kUdp; 281 if (protocol == Socket::Protocol::kTcp) { 283 } else if (protocol == Socket::Protocol::kUdp) {
|
H A D | udp_test.cpp | 323 transport_ = Connect(std::unique_ptr<Socket>(mock_socket_), &error);
|
Completed in 82 milliseconds