def attach(self, streamData=None, name=None):
"""
streamData: type BULKIO.SDDSStreamDefinition
name: user id (string)
The return value is the attachment id (use this to detach)
If there exists more than one connection, then the return value is a list
of all attachment id's generated
"""
if streamData == None:
streamData = createSDDSStreamDefinition()
if name == None:
name = _socket.gethostname()+'_user'
if not isinstance(streamData, _BULKIO.SDDSStreamDefinition):
raise Exception("streamData must be of type BULKIO.SDDSStreamDefinition")
if not isinstance(name, str):
raise Exception("name must be of <type 'str'>")
retval = self._src.attach(streamData, name)
if retval:
self._streamdefs[name] = streamData
return retval
评论列表
文章目录