udp networking problem(s)

While playing with udp i’ve encountered a ‘feature’ which i dont really know if it’s a bug or not.

If i send a udp package using this pseudocode and the ip ends with .0 the connection is reset.

hostNetAddress = NetAddress()
hostNetAddress.setHost( '127.0.0.0', 9099 )
self.qcWriter.send( package, self.udpSocket, netAddress )

I got another question about the udp networking. I am trying to send udp broadcasts, what i currently use is:

self.udpConnection = self.qcManager.openUDPConnection( self.udpPort )
self.udpConnection.getSocket().SetToBroadCast()
self.qcReader.addConnection( self.udpConnection )

im sending a udp package the same way as above using a address like ‘192.168.1.255’, however that doesnt seem to work, am i missing something (or i do it wrong) or is this not completely implemented? (i have a fallback way, sending to each address seperately, however if i dont neet to loop 254 times i could save some time)


my complete current code can be downloaded from http://public.nouser.org/~rspoerri/Development/python/panda3d/projects/p3d-framework/

in the current/src/network2/base directory (host2_0_5.py is currently the latest and can be called on it’s own)

I found a solution for the broadcasting, the old code works, the only problem was sending a package, this code seems to work for me:

netAddress = NetAddress()
netAddress.setAny( self.udpPort )

package = PyDatagram()
package.addUint16( messageId )
package.addString( data )
self.qcWriter.send( package, self.udpConnection, netAddress )