Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6173395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:33:54+00:00 2026-05-23T23:33:54+00:00

I am a beginner for Twisted. Recently, I am reading the book Twisted Network

  • 0

I am a beginner for Twisted. Recently, I am reading the book “Twisted Network Programming Essentials”.The Example 2-3 In this book as below:

class QuickDisconnectProtocol(protocol.Protocol): 

def connectionMade(self): 

    print "Connected to %s." % self.transport.getPeer( ).host 

    self.transport.loseConnection( ) 

==================================

self.transport.loseConnection( )

where is the member “transport”?
I couldn’t find that one in Protocol.

Same question when it comes to Ex2-4…

Does anyone have a clue on how to read Twisted Documents? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:33:55+00:00Added an answer on May 23, 2026 at 11:33 pm
    def makeConnection(self, transport): ([source][1])
        """
        overridden in twisted.protocols.amp.BinaryBoxProtocol,
        twisted.protocols.ftp.ProtocolWrapper, twisted.protocols.ftp.SenderProtocol, 
        twisted.protocols.policies.ProtocolWrapper, 
        twisted.protocols.stateful.StatefulProtocol`
    
        Make a connection to a transport and a server.
        This sets the 'transport' attribute of this Protocol, and calls the connectionMade() 
        callback.
        """
    

    The transport is the connection to the whatever you’re using, like telnet, SSH, a file, etc. Search the online API docs for transport and see i.e.

    http://twistedmatrix.com/documents/8.2.0/api/twisted.conch.ssh.transport.SSHTransportBase.html

    Here are some if the transports that exist, from
    http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.interfaces.ITransport.html

    Known subclasses: twisted.conch.insults.insults.ITerminalTransport, 
    twisted.conch.telnet.ITelnetTransport, twisted.internet.interfaces.IProcessTransport, 
    twisted.internet.interfaces.ITCPTransport
    
    Known implementations: twisted.conch.ssh.channel.SSHChannel, 
    twisted.internet._posixstdio.StandardIO, twisted.internet._win32stdio.StandardIO, 
    twisted.internet.abstract.FileDescriptor, twisted.internet.iocpreactor.abstract.FileHandle, 
    twisted.internet.protocol.FileWrapper, twisted.protocols.loopback._LoopbackTransport, 
    twisted.protocols.loopback.LoopbackRelay
    

    Depending on where you want to connect to, you use one of them when you call makeConnection(transport), and when you do that, it becomes an attribute of the protocol.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Beginner help needed :) I am doign an example form a php book which
Beginner here See - http://www.w3schools.com/js/tryit.asp?filename=try_dom_tablerow_cells In this example, when change content is pressed, new
Beginner Question. Below is an example given on the Cradle CouchDB documentation: https://github.com/cloudhead/cradle What
Beginner question. How come I can do this: Public Class Form1 Private StudentsInMyRoom As
Absolute beginner question: I have a template file index.html that looks like this: ...
As a complete beginner with no programming experience, I am trying to find beautiful
Beginner here. Why is this an endless loop ? for (p = 0; p
Beginner here: In this answer to my question of how to insert data into
Beginner in python, but been programming for about 5 years now. I suspect I
Beginner at Django here, I've been trying to fix this for a long time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.