Hi Ajay
No, they do not.
If I start that program a second (and third) time, bind errors out on all invocations.
root@colibri-imx6:~# ./can
vcan0 at index 1995515472
Error in socket bind: No such device
root@colibri-imx6:~# ./can
vcan0 at index 1995986512
Error in socket bind: No such device
root@colibri-imx6:~# ./can
vcan0 at index 1995888208
Error in socket bind: No such device
If I add a second call to bind in the program, that second call does fail too.
if (bind (s, (struct sockaddr *) &addr, sizeof (addr)) < 0)
{
perror ("Error in socket bind");
if (bind (s, (struct sockaddr *) &addr, sizeof (addr)) < 0)
{
perror ("Error in socket bind, 2nd time");
return -2;
}
}
.
root@colibri-imx6:~# ./can2
vcan0 at index 1996314192
Error in socket bind: No such device
Error in socket bind, 2nd time: No such device
Max