IrDAClient SocketException ErrorCode 10047

W

willy

Hi all,

I'm trying to create an System.Net.Sockets.IrDAClient instance with
Compact Framework 2.0 on a custom Windows CE 5.0 device. The creation
causes a SocketException with
ErrorCode 10047 to be thrown.

I found out, that also the creation of a System.Net.Sockets.Socket
instance as follows, causes the same SocketException with ErrorCode
10047:

Socket irdas = new Socket(AddressFamily.Irda, SocketType.Stream,
ProtocolType.IP);

ErrorCode 10047 indicates, that the chosen AddressFamily is not
supported
(http://support.microsoft.com/default.aspx?scid=kb;en-us;819124#XSLTH3193121122120121120120)

Thus, I wrote a native C++ application, where I create a Windows Socket
(code below) with AddressFamily=AF_IRDA and Type=SOCK_STREAM, which
works fine (e.g. the created socket is valid).

I would be thankfull for any ideas or indications. I spent a whole day
searching the web for a solution. I could provide more information if
requested.

Cheers Willy

--------------- Native Socket Creation Code ----------

WSADATA wsaData;
WORD wVersionRequested = 0x0101;
int wsaError;

wsaError = WSAStartup( wVersionRequested, &wsaData );
if ( wsaError != 0 ) {
printf("WSAStartup failed\n");
return FALSE;
}
printf("WSAStartup succeeded\n");

SOCKET irdasock = INVALID_SOCKET;
irdasock = socket(AF_IRDA, SOCK_STREAM, 0);

-------------------------------------------------------------------
 
A

Alan J. McFarlane

Check first what Address Family value is being used in each program.

AF_Irda.h has AF_IRDA as 26 for desktop and 22 for Windows CE. However
it appears that Windows CE supports the 26 value too, as for instance
that's how it appears to be defined on both .NET Frameworks... Perhaps
the custom build somehow only has the 22 value configured in the Winsock
definitions.


You could also try Peter Foot's (enhanced) version of IrDAClient to see
if it works, see http://32feet.net/.
--
Alan J. McFarlane
http://www.alanjmcf.me.uk/
Please follow-up in the newsgroup for the benefit of all.


In article
 
W

willy

Thanks Alan,

first tests indicated that my device supports AF = 26. But I will
confirm that on next Monday.
I'll also check out the enhanced IrDAClient.

Greetings Willy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top