object has no attribute 'channel' when connecting to server.

21 views
Skip to first unread message

y14u...@lnmiit.ac.in

unread,
Jun 20, 2018, 6:38:03 AM6/20/18
to PodSixNet
I am connecting to server. But when client connects. Then the error comes :-

error: uncaptured python exception, closing channel <__main__.WhiteboardServer listening localhost:8080 at 0x184e858fb00> (<class 'AttributeError'>:'WhiteboardServer' object has no attribute 'channel' [C:\ProgramData\Anaconda3\lib\asyncore.py|read|83] [C:\ProgramData\Anaconda3\lib\asyncore.py|handle_read_event|417] [C:\Users\sharm\Desktop\dominoes2\Domino_Data\PodSixNet\Server.py|handle_accept|35] [server_pod.py|Connected|55])

This is my server WhiteboardServer function :-

class WhiteboardServer(Server):
channelClass = ServerChannel
def __init__(self, *args, **kwargs):
self.game = Game()
self.id = 0
Server.__init__(self, *args, **kwargs)
self.players = WeakKeyDictionary()
print('Server launched')
self.connections = []
def NextId(self):
self.id += 1
return self.id
def Connected(self, channel, addr):
print('hello')
if(self.channel.number_of_connections_allowed > len(connections)):
self.connections.append(channel)
print('connected',channel,addr)
else:
print('connected')
channel.close()

def max_score(self,data):
self.game.max_score(data)

def player_info(self,data):
self.game.max_score(data)
def Launch(self):
while True:
self.Pump()
sleep(0.0001)

Please help me with the issue.

Chris McCormick

unread,
Jun 21, 2018, 11:47:02 PM6/21/18
to pods...@googlegroups.com, y14u...@lnmiit.ac.in
Hello,

You have used: `self.channel.number_of_connections_allowed` but the
WhiteboardServer object does not have a member called `channel`. Perhaps
you meant `self.number_of_connections_allowed` or
`channel.number_of_connections_allowed`.

Cheers,

Chris.
> --
> You received this message because you are subscribed to the Google
> Groups "PodSixNet" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to podsixnet+...@googlegroups.com
> <mailto:podsixnet+...@googlegroups.com>.
> To post to this group, send email to pods...@googlegroups.com
> <mailto:pods...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/podsixnet.
> For more options, visit https://groups.google.com/d/optout.

--
http://mccormick.cx/
Reply all
Reply to author
Forward
0 new messages