• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python reactor.connectTCP函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中nose.twistedtools.reactor.connectTCP函数的典型用法代码示例。如果您正苦于以下问题:Python connectTCP函数的具体用法?Python connectTCP怎么用?Python connectTCP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了connectTCP函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_listshares_SMB2

def test_listshares_SMB2():
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True

    factory = ListSharesFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:7,代码来源:test_listshares.py


示例2: test_store_long_filename_SMB1

def test_store_long_filename_SMB1():
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = False

    factory = StoreFilesFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service_name = 'smbtest'
    factory.filename = os.sep + 'StoreTest %d-%d.dat' % ( time.time(), random.randint(0, 10000) )
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:9,代码来源:test_storefile.py


示例3: test_unicode_directory_SMB2

def test_unicode_directory_SMB2():
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True

    factory = DirectoryFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service_name = 'smbtest'
    factory.path = os.sep + u'文件夹创建 %d-%d' % ( time.time(), random.randint(0, 1000) )
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:9,代码来源:test_createdeletedirectory.py


示例4: test_listshares_SMB2

def test_listshares_SMB2():
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True

    factory = ListSnapshotsFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service_name = 'smbtest'
    factory.path = '/rfc1001.txt'
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:9,代码来源:test_listsnapshots.py


示例5: test_listPath_SMB2

def test_listPath_SMB2():
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True

    factory = ListPathFactory(
        info["user"], info["password"], info["client_name"], info["server_name"], use_ntlm_v2=True
    )
    reactor.connectTCP(info["server_ip"], info["server_port"], factory)
    return factory.d
开发者ID:JariInc,项目名称:pysmb,代码行数:9,代码来源:test_listpath.py


示例6: test_rename_unicode_directory_SMB2

def test_rename_unicode_directory_SMB2():
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True

    factory = RenameDirectoryFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service = 'smbtest'
    factory.old_path = '/改名测试 %d-%d' % ( time.time(), random.randint(1000, 9999) )
    factory.new_path = '/改名测试 %d-%d' % ( time.time(), random.randint(1000, 9999) )
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:10,代码来源:test_rename.py


示例7: test_NTLMv2_auth_SMB2

def test_NTLMv2_auth_SMB2():
    def result(auth_passed):
        assert auth_passed

    smb_structs.SUPPORT_SMB2 = True
    info = getConnectionInfo()
    factory = AuthFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.d.addCallback(result)
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:10,代码来源:test_auth.py


示例8: test_rename_english_file_SMB2

def test_rename_english_file_SMB2():
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True

    factory = RenameFileFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service = 'smbtest'
    factory.old_path = '/RenameTest %d-%d.txt' % ( time.time(), random.randint(1000, 9999) )
    factory.new_path = '/RenameTest %d-%d.txt' % ( time.time(), random.randint(1000, 9999) )
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:10,代码来源:test_rename.py


示例9: test_retr_multiplereads_SMB2

def test_retr_multiplereads_SMB2():
    # Test file retrieval using multiple ReadAndx calls (assuming each call will not reach more than 65534 bytes)
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True

    factory = RetrieveFileFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service = 'smbtest'
    factory.path = '/rfc1001.txt'
    factory.digest = '5367c2bbf97f521059c78eab65309ad3'
    factory.filesize = 158437
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:12,代码来源:test_retrievefile.py


示例10: test_retr_unicodefilename_SMB2

def test_retr_unicodefilename_SMB2():
    # Test file retrieval that has a long non-English filename inside a folder with a non-English name
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True

    factory = RetrieveFileFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service = 'smbtest'
    factory.path = '/测试文件夹/垃圾文件.dat'
    factory.digest = '8a44c1e80d55e91c92350955cdf83442'
    factory.filesize = 256000
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:12,代码来源:test_retrievefile.py


示例11: test_retr_longfilename_SMB1

def test_retr_longfilename_SMB1():
    # Test file retrieval that has a long English filename
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = False

    factory = RetrieveFileFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service = 'smbtest'
    factory.path = '/Implementing CIFS - SMB.html'
    factory.digest = '671c5700d279fcbbf958c1bba3c2639e'
    factory.filesize = 421269
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:12,代码来源:test_retrievefile.py


示例12: test_retr_offset_SMB2

def test_retr_offset_SMB2():
    # Test file retrieval from offset to EOF
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True

    factory = RetrieveFileFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service = 'smbtest'
    factory.path = '/测试文件夹/垃圾文件.dat'
    factory.digest = 'a141bd8024571ce7cb5c67f2b0d8ea0b'
    factory.filesize = 156000
    factory.offset = 100000
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:13,代码来源:test_retrievefile.py


示例13: test_retr_offset_and_biglimit_SMB2

def test_retr_offset_and_biglimit_SMB2():
    # Test file retrieval from offset with a big max_length
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True

    factory = RetrieveFileFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service = 'smbtest'
    factory.path = '/测试文件夹/垃圾文件.dat'
    factory.digest = '83b7afd7c92cdece3975338b5ca0b1c5'
    factory.filesize = 100000
    factory.offset = 100000
    factory.max_length = 100000
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:14,代码来源:test_retrievefile.py


示例14: test_retr_offset_and_smalllimit_SMB2

def test_retr_offset_and_smalllimit_SMB2():
    # Test file retrieval from offset with a small max_length
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True

    factory = RetrieveFileFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service = 'smbtest'
    factory.path = '/测试文件夹/垃圾文件.dat'
    factory.digest = '746f60a96b39b712a7b6e17ddde19986'
    factory.filesize = 10
    factory.offset = 100000
    factory.max_length = 10
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:14,代码来源:test_retrievefile.py


示例15: test_retr_offset_and_zerolimit_SMB2

def test_retr_offset_and_zerolimit_SMB2():
    # Test file retrieval from offset to EOF with max_length=0
    info = getConnectionInfo()
    smb_structs.SUPPORT_SMB2 = True
    
    factory = RetrieveFileFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    factory.service = 'smbtest'
    factory.path = '/测试文件夹/垃圾文件.dat'
    factory.digest = 'd41d8cd98f00b204e9800998ecf8427e'
    factory.filesize = 0
    factory.offset = 100000
    factory.max_length = 0
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:14,代码来源:test_retrievefile.py


示例16: send_msg

def send_msg(host, port, msg, callback):
    factory = TestClientFactory(msg, callback)
    reactor.connectTCP(host, port, factory)
开发者ID:dhagge,项目名称:twistd-hl7,代码行数:3,代码来源:main_test.py


示例17: test_echo

def test_echo():
    info = getConnectionInfo()
    factory = EchoFactory(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True)
    reactor.connectTCP(info['server_ip'], info['server_port'], factory)
    return factory.d
开发者ID:50onRed,项目名称:pysmb,代码行数:5,代码来源:test_echo.py



注:本文中的nose.twistedtools.reactor.connectTCP函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python util.anyp函数代码示例发布时间:2022-05-27
下一篇:
Python trivial.ok_函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap