I'm trying to send a data using UDP socket and capture the data using a wireshark (under Windows7):
client_sockd= socket(AF_INET,SOCK_DGRAM,IPPROTO_IP);
client_address.sin_family = AF_INET;
client_address.sin_addr.s_addr = inet_addr("192.168.3.100");
client_address.sin_port=htons(8015);
client_len=sizeof(client_address);
int sended = sendto(client_sockd,buf,11,0,(const struct sockaddr *)&client_address,sizeof(client_address));
it's sending the packet to the correct ip but dest port becoming 2698. i'm trying to change the port in my code, but it doesnot have any effect to the real destination port. It's still to be 2698. How can i fix it?