OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium 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 LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_ | 5 #ifndef LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_ |
6 #define LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_ | 6 #define LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_ |
7 | 7 |
8 #include "nacl_io/ossocket.h" | 8 #include "nacl_io/ossocket.h" |
9 #ifdef PROVIDES_SOCKET_API | 9 #ifdef PROVIDES_SOCKET_API |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 virtual void QueueAccept(); | 32 virtual void QueueAccept(); |
33 virtual void QueueConnect(); | 33 virtual void QueueConnect(); |
34 virtual void QueueInput(); | 34 virtual void QueueInput(); |
35 virtual void QueueOutput(); | 35 virtual void QueueOutput(); |
36 | 36 |
37 virtual Error Accept(const HandleAttr& attr, | 37 virtual Error Accept(const HandleAttr& attr, |
38 PP_Resource* out_sock, | 38 PP_Resource* out_sock, |
39 struct sockaddr* addr, | 39 struct sockaddr* addr, |
40 socklen_t* len); | 40 socklen_t* len); |
41 virtual Error Bind(const struct sockaddr* addr, socklen_t len); | 41 virtual Error Bind(const struct sockaddr* addr, socklen_t len); |
42 virtual Error Listen(int backlog); | |
43 virtual Error Connect(const HandleAttr& attr, | 42 virtual Error Connect(const HandleAttr& attr, |
44 const struct sockaddr* addr, | 43 const struct sockaddr* addr, |
45 socklen_t len); | 44 socklen_t len); |
| 45 virtual Error GetSockOpt(int lvl, |
| 46 int optname, |
| 47 void* optval, |
| 48 socklen_t* len); |
| 49 virtual Error Listen(int backlog); |
| 50 virtual Error SetSockOpt(int lvl, |
| 51 int optname, |
| 52 const void* optval, |
| 53 socklen_t len); |
46 virtual Error Shutdown(int how); | 54 virtual Error Shutdown(int how); |
47 | 55 |
48 virtual void SetError_Locked(int pp_error_num); | 56 virtual void SetError_Locked(int pp_error_num); |
49 void ConnectDone_Locked(); | 57 void ConnectDone_Locked(); |
50 void ConnectFailed_Locked(); | 58 void ConnectFailed_Locked(); |
51 | 59 |
52 protected: | 60 protected: |
| 61 Error SetNoDelay(); |
53 virtual Error Recv_Locked(void* buf, | 62 virtual Error Recv_Locked(void* buf, |
54 size_t len, | 63 size_t len, |
55 PP_Resource* out_addr, | 64 PP_Resource* out_addr, |
56 int* out_len); | 65 int* out_len); |
57 | 66 |
58 virtual Error Send_Locked(const void* buf, | 67 virtual Error Send_Locked(const void* buf, |
59 size_t len, | 68 size_t len, |
60 PP_Resource addr, | 69 PP_Resource addr, |
61 int* out_len); | 70 int* out_len); |
62 | 71 |
63 ScopedEventEmitterTCP emitter_; | 72 ScopedEventEmitterTCP emitter_; |
64 PP_Resource accepted_socket_; | 73 PP_Resource accepted_socket_; |
| 74 bool tcp_nodelay_; |
65 }; | 75 }; |
66 | 76 |
67 | 77 |
68 } // namespace nacl_io | 78 } // namespace nacl_io |
69 | 79 |
70 #endif // PROVIDES_SOCKET_API | 80 #endif // PROVIDES_SOCKET_API |
71 #endif // LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_ | 81 #endif // LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_ |
OLD | NEW |