[CalendarServer-changes] [11999] CalendarServer/trunk/twext/protocols/echo.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:19:23 PDT 2014
Revision: 11999
http://trac.calendarserver.org//changeset/11999
Author: wsanchez at apple.com
Date: 2013-11-22 18:20:35 -0800 (Fri, 22 Nov 2013)
Log Message:
-----------
Add EchoProtocol for testing.
Added Paths:
-----------
CalendarServer/trunk/twext/protocols/echo.py
Added: CalendarServer/trunk/twext/protocols/echo.py
===================================================================
--- CalendarServer/trunk/twext/protocols/echo.py (rev 0)
+++ CalendarServer/trunk/twext/protocols/echo.py 2013-11-23 02:20:35 UTC (rev 11999)
@@ -0,0 +1,35 @@
+##
+# Copyright (c) 2013 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+"""
+Echo protocol.
+"""
+
+__all__ = ["EchoProtocol"]
+
+from twisted.internet.protocol import Protocol
+
+
+class EchoProtocol(Protocol):
+ """
+ Say what you hear.
+ """
+
+ def dataReceived(self, data):
+ """
+ As soon as any data is received, write it back.
+ """
+ self.transport.write(data)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/e501d952/attachment.html>
More information about the calendarserver-changes
mailing list