[New-bugs-announce] [issue18095] unable to invoke socket.connect with AF_UNSPEC

Roman Valov report at bugs.python.org
Wed May 29 16:07:24 CEST 2013

New submission from Roman Valov:

There is a way to "disconnect" UDP socket
that was previously "connected" to specific
remote endpoint in C:

  struct sockaddr_in sin;        
  memset((char *)&sin, 0, sizeof(sin));
  sin.sin_family = AF_UNSPEC;
  connect(fd, (struct sockaddr *)&sin, sizeof(sin));

However in this is not available in python, since connect
accepts only (host, port) as a parameter for UDP socket.

It's possible to drop "port" connection with port=0,
however I can't find a way to drop "host" connection.

components: IO
messages: 190308
nosy: Roman.Valov
priority: normal
severity: normal
status: open
title: unable to invoke socket.connect with AF_UNSPEC
type: behavior
versions: Python 3.3

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list