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

Side by Side Diff: net/tools/testserver/xmppserver.py

Issue 5104004: Spin up XMPP server for testservers of type sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed merge error Created 10 years 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
« no previous file with comments | « net/tools/testserver/testserver.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python2.4 1 #!/usr/bin/python2.4
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """A bare-bones and non-compliant XMPP server. 6 """A bare-bones and non-compliant XMPP server.
7 7
8 Just enough of the protocol is implemented to get it to work with 8 Just enough of the protocol is implemented to get it to work with
9 Chrome's sync notification system. 9 Chrome's sync notification system.
10 """ 10 """
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 513
514 def __init__(self, socket_map, addr): 514 def __init__(self, socket_map, addr):
515 asyncore.dispatcher.__init__(self, None, socket_map) 515 asyncore.dispatcher.__init__(self, None, socket_map)
516 self.create_socket(socket.AF_INET, socket.SOCK_STREAM) 516 self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
517 self.set_reuse_addr() 517 self.set_reuse_addr()
518 self.bind(addr) 518 self.bind(addr)
519 self.listen(5) 519 self.listen(5)
520 self._socket_map = socket_map 520 self._socket_map = socket_map
521 self._socket_map[self.fileno()] = self 521 self._socket_map[self.fileno()] = self
522 self._connections = set() 522 self._connections = set()
523 print 'XMPP server running at %s' % AddrString(addr)
524 523
525 def handle_accept(self): 524 def handle_accept(self):
526 (sock, addr) = self.accept() 525 (sock, addr) = self.accept()
527 XmppConnection(sock, self._socket_map, self._connections, addr) 526 XmppConnection(sock, self._socket_map, self._connections, addr)
OLDNEW
« no previous file with comments | « net/tools/testserver/testserver.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698