Great, how would connecting work? (mimicking the client to test a few things)

On Tue, 25 Nov 2014 14:10:46 GMT, akaDemik wrote:

On Tue, 25 Nov 2014 11:39:50 GMT, maarten wrote:

I have a client that connects through udp at a given port. In the received packets, source port is set and is the port the client assumes the server will respond at. This is normal behaviour according to wikipedia.
In vibed, I see no way to access that source_port field in udp packets, how is it dealt with?

UDPConnection.recv have optional parameter NetworkAddress peer_address.
UDP echo example, sends packet back to source ip:port:

shared static this()
{
	NetworkAddress addr;
	auto udp_listener = listenUDP(1234);
	while (true) {
		auto pack = udp_listener.recv(null, &addr);
		udp_listener.send(pack, &addr);
	}
}