added code to get ip and port from socket descriptor in sendPacket using getsockname