Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/event_emitter_udp.cc

Issue 23498015: [NaCl SDK] Support non blocking TCP/UDP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "nacl_io/event_emitter_udp.h"
6
7 #include <poll.h>
8 #include <stdint.h>
9 #include <stdlib.h>
10
11 #include "sdk_util/auto_lock.h"
12
13 namespace nacl_io {
14
15 EventEmitterUDP::EventEmitterUDP(size_t rsize, size_t wsize)
16 : in_fifo_(std::max<size_t>(1, rsize)),
17 out_fifo_(std::max<size_t>(1, wsize)) {
18 UpdateStatus_Locked();
19 }
20
21 Packet* EventEmitterUDP::ReadRXPacket_Locked() {
22 Packet* packet = in_fifo_.ReadPacket();
23
24 UpdateStatus_Locked();
25 return packet;
26 }
27
28 void EventEmitterUDP::WriteRXPacket_Locked(Packet* packet) {
29 in_fifo_.WritePacket(packet);
30
31 UpdateStatus_Locked();
32 }
33
34 Packet* EventEmitterUDP::ReadTXPacket_Locked() {
35 Packet* packet = out_fifo_.ReadPacket();
36
37 UpdateStatus_Locked();
38 return packet;
39 }
40
41 void EventEmitterUDP::WriteTXPacket_Locked(Packet* packet) {
42 out_fifo_.WritePacket(packet);
43
44 UpdateStatus_Locked();
45 }
46
47 } // namespace nacl_io
48
49
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/event_emitter_udp.h ('k') | native_client_sdk/src/libraries/nacl_io/event_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698