Broadcast socket bind on Windows; '<broadcast>' or ''

Irmen de Jong irmen at
Sun Feb 16 19:22:55 CET 2003

Irmen de Jong wrote:

> I will try to hack together a quick C program that calls
> the bsd (actually winsock) API directly and see what that
> does with different bind addresses under windows.

The results of this are that binding on INADDR_ANY ('') works,
and binding on INADDR_BROADCAST ('' or
'<broadcast>') fails with a winsock error "cannot assign
requested address".

So I will add the following check:
if running windows --> use ''
otherwise --> use '<broadcast>'



More information about the Python-list mailing list