Send UDP packet to dest + specific Local port?

I need to send a UDP packet to specified IP & port with Specified local/source port.

How do I do it ? this is what I want to work

sockets[0].socket = wip_UDPCreateOpts( evh_udp, &sockets[0],
						  WIP_COPT_PEER_STRADDR,	Globals.servername,
						  WIP_COPT_PEER_PORT,		PEER_PORT,
						  WIP_COPT_PORT,			LOCAL_PORT,
						  WIP_COPT_END);

case WIP_CEV_WRITE: // socket is writable

		wip_getOpts(ev->channel,
					  WIP_COPT_PEER_ADDR,	&sockets[0].PeerIPaddr,
					  WIP_COPT_BOUND,		&sockets[0].isbound,
					  WIP_COPT_END

			  	  	  );

error = wip_writeOpts( sockets[0].socket, "hello",5,
								WIP_COPT_PEER_ADDR,	sockets[0].PeerIPaddr,
								WIP_COPT_PEER_PORT,	PEER_PORT,
								WIP_COPT_PORT,		LOCAL_PORT,
								WIP_COPT_END);

However, after trying all permutations of UDP server sockets & client sockets, all I can say is that Server sockets only send from a “Bound” incoming port, ie you cannot send until received. & client sockets do not accept wip_writeOpts() - I’m trying to do a bit of both.

I am wrestling with this wip lib :imp: there is no consistent “philosophy” to it, everything works as per the examples/docs but deviate even slightly & it does not work. for example using the same code for multiple bound/unbound UDP sockets + TCP sockets.

wip_readOpts() nor wip_GetOpts() work on TCP client sockets
&
wip_read() does not work on UDP sockets

You cannot use wip_writeOpts() with a Server socket, despite secifying every thing, cause the “channel not ready” ie it wants the channel from an incoming packet/connection (does not exist yet)

Hi

What exactly you mean by that? Have you checked out the return value you get in these cases?

Anyone got more info on my question ?? How do you send a UDP packet with everything specced ? I am attempting to pierce firewalls.

Various return values like Invalid function, or invalid param (terms as I remember them). I realise that the documentation lists which functions work with which context, however they do not say which are incompatible. So in philosophical terms why should wip_readOpts() fail when used with a client socket ?? even if unnecessary ??

Note that firewalls can be configured to simply block all UDP traffic…

And this is helpful information ??, firewalls can also be setup to block port 80 :laughing:

Anyone on topic ?

The point being, if the firewall is set to just block all UDP packets, then no amount of fiddling with your UDP sending options is going to get around that!

back to the topic please :slight_smile: