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

Unified Diff: net/web2socket_proxy/web2socket.cc

Issue 5484001: Web2socket proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for signed/unsigned confusion + cosmetic Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/web2socket_proxy/web2socket.h ('k') | net/web2socket_proxy/web2socket_conn.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/web2socket_proxy/web2socket.cc
diff --git a/net/web2socket_proxy/web2socket.cc b/net/web2socket_proxy/web2socket.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e9d7211bf0375a00a6927fc3a8fed0286fd26f02
--- /dev/null
+++ b/net/web2socket_proxy/web2socket.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <stdlib.h>
+
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include "web2socket_serv.h"
+
+struct sockaddr;
+
+void RunWeb2SocketServer(const std::string& origin,
+ struct sockaddr* addr,
+ int addr_len) {
+ for (int step = 0;; step += (step < 10)) {
+ int p = fork();
+ if (p == 0) {
+ if (Web2SocketServ::IgnoreSigPipe()) {
+ Web2SocketServ ws(origin, addr, addr_len);
+ ws.Run();
+ }
+ exit(1);
+ }
+ if (p > 0)
+ waitpid(p, NULL, 0);
+ sleep(1 << step);
+ }
+}
+
« no previous file with comments | « net/web2socket_proxy/web2socket.h ('k') | net/web2socket_proxy/web2socket_conn.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698