This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Win32 gcj: How to create a shared library and other w32 issues


Jost Boekemeier  wrote:
> Third question: Does anyone know how to ask for the available bytes after
> opening a socket connection? -- gcj says that it is not supported on Win32,
> but somehow I don't believe this. :)
> 


Would something like this work?

Danny

#include <winsock2.h>

int inavail_winsock(SOCKET socket)
{
    int err;
    unsigned long num = 0;
    if (ioctlsocket (socket, FIONREAD, &num) == 0)
      return num;
    err = WSAGetLastError();
    /* handle it */
    return 0;
}

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]