Commit d733113e authored by Shane Kerr's avatar Shane Kerr
Browse files

Allow user to specify port to connect on.



git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@236 e5f2f494-b856-4b98-b285-d166d9295462
parent c7c99151
...@@ -13,10 +13,6 @@ ...@@ -13,10 +13,6 @@
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# XXX
import pprint
from ISC.Util import hexdump
import sys import sys
import socket import socket
import struct import struct
...@@ -28,7 +24,7 @@ class NetworkError(Exception): pass ...@@ -28,7 +24,7 @@ class NetworkError(Exception): pass
class SessionError(Exception): pass class SessionError(Exception): pass
class Session: class Session:
def __init__(self): def __init__(self, port=9912):
self._socket = None self._socket = None
self._lname = None self._lname = None
self._recvbuffer = bytearray() self._recvbuffer = bytearray()
...@@ -38,7 +34,7 @@ class Session: ...@@ -38,7 +34,7 @@ class Session:
try: try:
self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self._socket.connect(tuple(['127.0.0.1', 9912])) self._socket.connect(tuple(['127.0.0.1', port]))
self.sendmsg({ "type": "getlname" }) self.sendmsg({ "type": "getlname" })
msg = self.recvmsg(False) msg = self.recvmsg(False)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment