Greg,
Thanks for the info, see my comments in brackets below. The problem I am having is once the Wishield establishes a connection with a pc source port I unable to connect to the wishield with another source port. The destination port to the Wishield is correct and unchanged on each send. I attached some images from wishark and udp send program to explain further. The UDP send program can be found at
http://www.codeproject.com/KB/IP/UDP_Send_Receive.aspx. Hopefully this explains what I am trying to do. Any help you could provide would be appreciated.
If your C# library is changing the destination port on you (not the source port) then I'd take a look at the API to make sure that it is being used correctly or toss it as it is doing the wrong thing. [No, it is not. It is sending to the correct destination port, but the source port is changing]
If you want each button to send to a different port on the WiShield then you will need to tell the WiShield to "listen" on two ports (destination ports) and have each button's code send to the appropriate destination port. A simpler approach would be to include a small header in the packet payload that describes what button (or functionality) sent the packet. This way you can "listen" on just a single port and your code would parse the header and do the right thing. [I understand, but this is not what I want to do.]
In the example code using HTONS(0) does not connect (UDP is connectionless) it merely says create a new UDP socket with the destination port of 0 (in the context of that code). The UDP socket on the WiShield does not become "active" until the call to uip_udp_bind() - which tells the uIP stack that you want it to pay attention to incoming data on the port that you give it - 12344 in this case. [OK, I understand now]
If your strategy is to have the WiShield differentiate which button sent the data based upon the source port then I'd rethink things (unless you have the ability to specify both the source and destination ports). I would opt for adding a small header to the packet payload (for instance a single byte that identifies which button it came from). [No, this is not what I am looking to do.]