Board index » Visual Studio » CAsyncSocket on vista

CAsyncSocket on vista

Visual Studio8
We have a Windows service which is a part of our product which uses

CAsyncSocket to communicate with another EXE running on the same machine. I

have used VC++6.0 to compile the code for the both the service as well as the

EXE. The interprocess communication works fine on Win XP, Win2000, and other

versions of Windows for the last 5 years.



I compiled the programs on Windows Vista using VC++ 6.0. The 'win32 debug'

configuration build seems to work fine. However in the 'Win 32 release'

configuration build, the socket communcation fails. I ran the service using a

debugger, I found out the CAsyncSocket::Connect() fails and the error code

obtained by calling GetLastError() is 10047. Any ideas why this could be

happening?



Thanks and Regards,

-Prashant Hardikar


-
 

Re:CAsyncSocket on vista

It helps if you actually give the text of the error code, e.g., an address incompatible

with the protocol has been given.



Otherwise, there isn't really enough information here. What protocol were you using? What

socket #?

joe

On Wed, 14 Nov 2007 13:53:00 -0800, Prashant Hardikar <Prashant

Hardikar@discussions.microsoft.com>wrote:



Quote
We have a Windows service which is a part of our product which uses

CAsyncSocket to communicate with another EXE running on the same machine. I

have used VC++6.0 to compile the code for the both the service as well as the

EXE. The interprocess communication works fine on Win XP, Win2000, and other

versions of Windows for the last 5 years.



I compiled the programs on Windows Vista using VC++ 6.0. The 'win32 debug'

configuration build seems to work fine. However in the 'Win 32 release'

configuration build, the socket communcation fails. I ran the service using a

debugger, I found out the CAsyncSocket::Connect() fails and the error code

obtained by calling GetLastError() is 10047. Any ideas why this could be

happening?



Thanks and Regards,

-Prashant Hardikar

Joseph M. Newcomer [MVP]

email: newcomer@flounder.com

Web: www.flounder.com">www.flounder.com

MVP Tips: www.flounder.com/mvp_tips.htm">www.flounder.com/mvp_tips.htm

-

Re:CAsyncSocket on vista

I am sorry for not giving the text of the error message. I am using TCP/IP

data stream socket. The port on which the service listens is 2500 and the

port on which EXE listens is 2502.

-Prashant.



"Joseph M. Newcomer" wrote:



Quote
It helps if you actually give the text of the error code, e.g., an address incompatible

with the protocol has been given.



Otherwise, there isn't really enough information here. What protocol were you using? What

socket #?

joe

On Wed, 14 Nov 2007 13:53:00 -0800, Prashant Hardikar <Prashant

Hardikar@discussions.microsoft.com>wrote:



>We have a Windows service which is a part of our product which uses

>CAsyncSocket to communicate with another EXE running on the same machine. I

>have used VC++6.0 to compile the code for the both the service as well as the

>EXE. The interprocess communication works fine on Win XP, Win2000, and other

>versions of Windows for the last 5 years.

>

>I compiled the programs on Windows Vista using VC++ 6.0. The 'win32 debug'

>configuration build seems to work fine. However in the 'Win 32 release'

>configuration build, the socket communcation fails. I ran the service using a

>debugger, I found out the CAsyncSocket::Connect() fails and the error code

>obtained by calling GetLastError() is 10047. Any ideas why this could be

>happening?

>

>Thanks and Regards,

>-Prashant Hardikar

Joseph M. Newcomer [MVP]

email: newcomer@flounder.com

Web: www.flounder.com">www.flounder.com

MVP Tips: www.flounder.com/mvp_tips.htm">www.flounder.com/mvp_tips.htm



-

Re:CAsyncSocket on vista

The error you are getting is WSAEAFNOSUPPORT - Address Family Not

Supported



Perhaps when you are setting up your socket you are not initialising all

the fields or something.



Could be a VC 6 problem.



If you Google WSAEAFNOSUPPORT, you get a few zillion hits. Here is one of

them.





WSAEAFNOSUPPORT (10047) Address family not supported by protocol family.



Berkeley description: An address incompatible with the requested protocol

was used. For example, you shouldn't necessarily expect to be able to use

NS addresses with ARPA Internet protocols.



WinSock description: Same as Berkeley, and then some. The error occurs

with the function, which takes the socket type (protocol) and address

family as input parameters.



It also occurs with functions that take a socket handle and a sockaddr

structure as input parameters. A socket already has a type (a protocol),

and each sockaddr structure has an address family field to define its

format. A function fails with WSAEAFNOSUPPORT if the address family

referenced in sockaddr is not compatible with the referenced socket's

protocol.



This error apparently also takes the place of WSAEPFNOSUPPORT (which means

"protocol family not supported"), since that error is not listed for in

the v1.1 WinSock specification.





Quote
-----Original Message-----

From: Prashant Hardikar

[mailto:PrashantHardikar@discussions.microsoft.com]

Posted At: Friday, 16 November 2007 2:29 AM

Posted To: microsoft.public.vc.mfc

Conversation: CAsyncSocket on vista

Subject: Re: CAsyncSocket on vista



I am sorry for not giving the text of the error message. I am using

TCP/IP

data stream socket. The port on which the service listens is 2500 and

the

port on which EXE listens is 2502.

-Prashant.



"Joseph M. Newcomer" wrote:



>It helps if you actually give the text of the error code, e.g., an

address incompatible

>with the protocol has been given.

>

>Otherwise, there isn't really enough information here. What protocol

were you using? What

>socket #?

>joe

>On Wed, 14 Nov 2007 13:53:00 -0800, Prashant Hardikar <Prashant

>Hardikar@discussions.microsoft.com>wrote:

>

>>We have a Windows service which is a part of our product which uses

>>CAsyncSocket to communicate with another EXE running on the same

machine. I

>>have used VC++6.0 to compile the code for the both the service as

well as the

>>EXE. The interprocess communication works fine on Win XP, Win2000,

and other

>>versions of Windows for the last 5 years.

>>

>>I compiled the programs on Windows Vista using VC++ 6.0. The 'win32

debug'

>>configuration build seems to work fine. However in the 'Win 32

release'

>>configuration build, the socket communcation fails. I ran the

service using a

>>debugger, I found out the CAsyncSocket::Connect() fails and the

error code

>>obtained by calling GetLastError() is 10047. Any ideas why this

could be

>>happening?

>>

>>Thanks and Regards,

>>-Prashant Hardikar

>Joseph M. Newcomer [MVP]

>email: newcomer@flounder.com

>Web: www.flounder.com">www.flounder.com

>MVP Tips: www.flounder.com/mvp_tips.htm">www.flounder.com/mvp_tips.htm

>



-