Interface to isectd working!!!

Thomas Gagne tgagne at ix.netcom.com
Wed Aug 9 16:53:18 EDT 2000


Ok, I'm on like my 3rd for 4th day with Python, and I've already got the
client interface working with the isectd middlware libraries.  My test client
doesn't do anything particularly heavy, but by just sending a newline
character to the 'op' service I'm getting a response!!

#!/usr/local/bin/python
# http://home.netcom.com/~tgagne

from IsdIO import *

#grab a reference to the interface library

ioLib = IsdIO()

#open a connection to the default service, 'op'

s = ioLib.login(None, None, 2)

# s is the socket handle returned, but we don't
# use it because it's saved inside ioLib, but
# it does give us something to test if the connection
# worked.

if s >= 0:
 print "Connected to an isectd"

 #send a nothing message
 bytes = ioLib.send('\n')

 #get a copy of something to receive the reply into
 m = IsdMessage()

 #tell my message object (m) to get a message from the connection
 bytes = m.get(ioLib)
 if bytes > 0:
  print m.message

 ioLib.logout()

When I run it, I get something wonderful--output!!!

isdclient.py
Connected to an isectd
isdData.configfile       = ""
isdData.host             = "tgagne"
isdData.ServiceList      = 1
isdData.PriList          = 1
isdData.LazyWorkers      = 0
isdData.IdleWorkers      = 0
isdData.BusyWorkers      = 0
isdData.socket           = 5
isdData.port             = 1963
isdData.req_socket       = 6
isdData.req_port         = 5501
isdData.NextClientID     = 20
isdData.MaxUsers         = 0
isdData.command_worker   = "op"
isdData.Events           = 0
isdData.NumEvents        = 0
isdData.NumBuckets       = 6
isdData.BucketSecs       = 10
isdData.PeakBucket       = 0
isdData.Buckets          = 0  0  0  0  0  0




More information about the Python-list mailing list