Table of Contents

Class: Port | Twisted-0.17.4/twisted/internet/udp.py
--- | ---

I am a UDP server port, listening for packets.

Base Classes |
--- | ---
abstract.FileDescriptor

Methods |
--- | ---

__getstate__ __init__ __repr__ connectionLost createConnection createInternetSocket doRead | doWrite getHost logPrefix loseConnection setLogStr startListening

| __getstate__

    __getstate__ ( self )

(internal) get my state for persistence

| __init__

    __init__ (
            self,
            port,
            factory,
            interface='',
            maxPacketSize=8192,
            )

Initialize with a numeric port to listen on.

| __repr__

    __repr__ ( self )

| connectionLost

    connectionLost ( self )

Cleans up my socket.

| createConnection

    createConnection ( self,  addr )

Creates a virtual connection over UDP

| createInternetSocket

    createInternetSocket ( self )

(internal) create an AF_INET/SOCK_DGRAM socket.

| doRead

    doRead ( self )

Called when my socket is ready for reading.

| doWrite

    doWrite ( self )

Raises an AssertionError.

| getHost

    getHost ( self )

Returns a tuple of (`INET_UDP`, hostname, port), indicating the servers address

| logPrefix

    logPrefix ( self )

Returns the name of my class, to prefix log entries with.

| loseConnection

    loseConnection ( self )

### Stop accepting connections on this port.

This will shut down my socket and call self.connectionLost().

| setLogStr

    setLogStr ( self )

| startListening

    startListening ( self )

### Create and bind my socket, and begin listening on it.

This is called on unserialization, and must be called after creating a server to begin listening on the specified port.

Table of Contents

This document was automatically generated on Sat Apr 20 01:30:49 2002 by HappyDoc version 2.0