forked from plivo/plivoframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove MANIFEST.in, README.txt, VERSION.txt, update gitignore, split …
…transport, move tests
- Loading branch information
Michael Ricordeau
committed
Apr 26, 2011
1 parent
7658ddf
commit 1611376
Showing
14 changed files
with
48 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
*.pyc | ||
*.egg | ||
*egg* | ||
dist* | ||
build* | ||
src/dist* | ||
src/build* | ||
src/*egg* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Freeswitch Transport classes | ||
""" | ||
|
||
import gevent.socket as socket | ||
from plivo.core.errors import ConnectError | ||
from plivo.core.transport import Transport | ||
|
||
|
||
class InboundTransport(Transport): | ||
def __init__(self, host, port, connect_timeout=5): | ||
self.host = host | ||
self.port = port | ||
self.timeout = connect_timeout | ||
self.sockfd = None | ||
|
||
def connect(self): | ||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
self.sock.settimeout(self.timeout) | ||
self.sock.connect((self.host, self.port)) | ||
self.sock.settimeout(None) | ||
self.sockfd = self.sock.makefile() | ||
|
||
def write(self, data): | ||
if not self.sockfd: | ||
raise ConnectError('not connected') | ||
self.sockfd.write(data) | ||
self.sockfd.flush() | ||
|
||
|
||
|
||
class OutboundTransport(Transport): | ||
def __init__(self, socket, address, connect_timeout=5): | ||
self.sock = socket | ||
self.sockfd = socket.makefile() | ||
self.address = address | ||
self.timeout = connect_timeout | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.
File renamed without changes.