Your message dated Sun, 13 Jan 2008 09:38:24 +0100
with message-id <[EMAIL PROTECTED]>
and subject line Bug#245828: wine: winsock doesn't close ports open for listen
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: wine
Version: 0.0.20040309-1
Severity: normal

Compile the following example (eg. I did with mingw: i586-mingw32msvc-g++ -o 
winsock.exe winsock.c -mconsole -lwsock32).
If the resulting exe-file is executed under Windows 9x, both calls to 
WinSockListen return a valid socket.
If the programm is executed with wine, the second call returns an error. 
netstat shows, that the port remains open, until the programm ends, even if the 
only socket for that port is closed.


mfg Martin K?gler


Example (winsock.c):

#include <stdio.h>
#include <windows.h>
#include <winsock2.h>


int WinSockInit()
{
WSADATA d;
WORD v;
v=MAKEWORD(2,2);
if(WSAStartup(v,&d)!=0)return -1;
if(LOBYTE(d.wVersion)!=2||HIBYTE(d.wVersion)!=2)
{WSACleanup();return -1;}
 return 0;
}
void WinSockEnd()
{
  WSACleanup();
}
void WinSockClose(SOCKET s)
{
  shutdown(s,SD_BOTH);
  closesocket(s);
}
SOCKET WinSockListen(int port)
{
 SOCKET s;
  struct sockaddr_in a;
  memset(&a,0,sizeof(a));
  a.sin_family=AF_INET;
  a.sin_addr.s_addr=INADDR_ANY;
  a.sin_port=htons(port);
  s=socket(PF_INET,SOCK_STREAM,0);
  if(s==INVALID_SOCKET)return s;
  if(bind(s,(sockaddr*)&a,sizeof(a))==SOCKET_ERROR)
    {closesocket(s);return INVALID_SOCKET;}
  listen(s,5);
  return s;
 }

int main()
{
  SOCKET s;
  WinSockInit();
  printf("Start\n");
  s=WinSockListen(23432);
  printf("Open=%d\n",s);
  WinSockClose(s);
  s=WinSockListen(23432);
  printf("Open=%d\n",s);
  WinSockClose(s);
  WinSockEnd();
}



-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux pc2 2.4.20-su-su #1 Wed Dec 11 11:44:44 CET 2002 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages wine depends on:
ii  debconf                   1.2.23         Debian configuration management sy
ii  libwine                   0.0.20040309-1 Windows Emulator (Library)
ii  xbase-clients [xcontrib]  4.3.0-7        miscellaneous X clients

-- debconf information:
  wine/del_wine_conf: true
  wine/install_type: Autodetect



--- End Message ---
--- Begin Message ---
This has apparently been fixed, I don't know when. I'll just close it.




--- End Message ---

Reply via email to