| OLD | NEW |
| 1 // Copyright (c) 2012 The Native Client Authors. All rights reserved. | 1 // Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PACKAGES_LIBRARIES_NACL_MOUNTS_NET_SOCKET_H_ | 5 #ifndef PACKAGES_LIBRARIES_NACL_MOUNTS_NET_SOCKET_H_ |
| 6 #define PACKAGES_LIBRARIES_NACL_MOUNTS_NET_SOCKET_H_ | 6 #define PACKAGES_LIBRARIES_NACL_MOUNTS_NET_SOCKET_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 virtual void close(); | 33 virtual void close(); |
| 34 virtual int read(char* buf, size_t count, size_t* nread); | 34 virtual int read(char* buf, size_t count, size_t* nread); |
| 35 virtual int write(const char* buf, size_t count, size_t* nwrote); | 35 virtual int write(const char* buf, size_t count, size_t* nwrote); |
| 36 | 36 |
| 37 virtual int fcntl(int cmd, va_list ap); | 37 virtual int fcntl(int cmd, va_list ap); |
| 38 | 38 |
| 39 virtual bool is_read_ready(); | 39 virtual bool is_read_ready(); |
| 40 virtual bool is_write_ready(); | 40 virtual bool is_write_ready(); |
| 41 virtual bool is_exception(); | 41 virtual bool is_exception(); |
| 42 | 42 |
| 43 void GetAddress(struct sockaddr* addr); |
| 43 private: | 44 private: |
| 44 void Connect(int32_t result, const char* host, uint16_t port, int32_t* pres); | 45 void Connect(int32_t result, const char* host, uint16_t port, int32_t* pres); |
| 45 void OnConnect(int32_t result, int32_t* pres); | 46 void OnConnect(int32_t result, int32_t* pres); |
| 46 | 47 |
| 47 void Read(int32_t result, int32_t* pres); | 48 void Read(int32_t result, int32_t* pres); |
| 48 void OnRead(int32_t result, int32_t* pres); | 49 void OnRead(int32_t result, int32_t* pres); |
| 49 | 50 |
| 50 void Write(int32_t result, int32_t* pres); | 51 void Write(int32_t result, int32_t* pres); |
| 51 void OnWrite(int32_t result, int32_t* pres); | 52 void OnWrite(int32_t result, int32_t* pres); |
| 52 | 53 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 65 std::vector<char> out_buf_; | 66 std::vector<char> out_buf_; |
| 66 std::vector<char> read_buf_; | 67 std::vector<char> read_buf_; |
| 67 std::vector<char> write_buf_; | 68 std::vector<char> write_buf_; |
| 68 bool write_sent_; | 69 bool write_sent_; |
| 69 | 70 |
| 70 DISALLOW_COPY_AND_ASSIGN(TCPSocket); | 71 DISALLOW_COPY_AND_ASSIGN(TCPSocket); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 #endif // PACKAGES_LIBRARIES_NACL_MOUNTS_NET_SOCKET_H_ | 74 #endif // PACKAGES_LIBRARIES_NACL_MOUNTS_NET_SOCKET_H_ |
| 74 | 75 |
| OLD | NEW |