I'm trying to use a multiplayer module called PodSixNet to use in one of my games, but I get an error in assyncore.py
when trying to run the client. However, the server works flawlessly. I developed simple test client and server programs, but I still get the same error when I run the client. Here are my client and server programs respectively:
import PodSixNet, time
from PodSixNet.Connection import ConnectionListener, connection
from time import sleep
class MyNetworkListener(ConnectionListener):
connection.Connect()
def Network(self, data):
print data
gui = MyPlayerListener()
while 1:
connection.Pump()
gui.Pump()
.
import PodSixNet, time
from time import sleep
from PodSixNet.Channel import Channel
from PodSixNet.Server import Server
class ClientChannel(Channel):
def Network(self, data):
print data
class MyServer(Server):
channelClass = ClientChannel
def Connected(self, channel, addr):
print "new connection:", channel
myserver = MyServer()
while True:
myserver.Pump()
sleep(0.0001)
And here is the error I'm returned when I run the client:
Traceback (most recent call last):
File "C:\Users\Matt\Desktop\The 37th Battalion\PodSixNet Tests\client.py", line 5, in <module>
class MyNetworkListener(ConnectionListener):
File "C:\Users\Matt\Desktop\The 37th Battalion\PodSixNet Tests\client.py", line 7, in MyNetworkListener
connection.Connect()
File "C:\Python27\lib\asyncore.py", line 418, in __getattr__
retattr = getattr(self.socket, attr)
File "C:\Python27\lib\asyncore.py", line 418, in __getattr__
retattr = getattr(self.socket, attr)
File "C:\Python27\lib\asyncore.py", line 418, in __getattr__
retattr = getattr(self.socket, attr)
File "C:\Python27\lib\asyncore.py", line 418, in __getattr__
retattr = getattr(self.socket, attr)
This error continues until I reach maximum recursion depth. Help would be greatly appreciated.
Thanks, David
First, you have to tell the server which port it should listen on:
server.py
Then, the client has to connect to this port:
client.py
You don't have to call
Connect()
onconnection
, but on theConnectionListener
instance.