15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


AfxSocketInit().

SCS.007@mch.scn.de
Monday, December 16, 1996


Environment : VC++ 1.52, Windows 3.11

Hi!,

I am having a problem with CAsyncSocket. The scenario is this.

     |------------|           |------------|
     |userapp.exe |	      | initialiser|
     |            |           |            |
     |------------|           |------------|
          |                       |
sendFile()|                       | InitialiseServices()
          |                       |
          |     |------------|    |
          |---->|     DLL    |<---|
                |            |
		|------------|


My DLL provides some n/w services like sending files, and messages across the 
n/w. The services are initialised by the initialiser application by the func 
InitialiseServices() which internally calls AfxSocketInit(). This call is 
successful.
After that, when I try to send ANYTHING across the n/w, I get an errcode of 
10093 which means, a successful call to AfxSocketInit() has not occured. 
Socket creation is successful, but when I call send, it fails. Any idea why.

Since the call to AfxSocketInit() is in the DLL, it shouldn't pose problems( 
atleast I think so ).

Thanks in advance.

Regards,
Chandru - scs.007@mch.scn.de

PS : Hi David, thanks for sending this across!!



Phil Daley -- pdaley@relay.com
Wednesday, December 18, 1996

[Mini-digest: 2 responses]

I don't understand.  The DLL calls AfxSockInit() right?

Who is calling socket() and send()??


At 07:23 AM 12/16/96 GMT, SCS.007@mch.scn.de wrote:
 
>I am having a problem with CAsyncSocket. The scenario is this.
>
>     |------------|           |------------|
>     |userapp.exe |	      | initialiser|
>     |            |           |            |
>     |------------|           |------------|
>          |                       |
>sendFile()|                       | InitialiseServices()
>          |                       |
>          |     |------------|    |
>          |---->|     DLL    |<---|
>                |            |
>		|------------|
>
>
>My DLL provides some n/w services like sending files, and messages across the 
>n/w. The services are initialised by the initialiser application by the func 
>InitialiseServices() which internally calls AfxSocketInit(). This call is 
>successful.
>After that, when I try to send ANYTHING across the n/w, I get an errcode of 
>10093 which means, a successful call to AfxSocketInit() has not occured. 
>Socket creation is successful, but when I call send, it fails. Any idea why.
>
>Since the call to AfxSocketInit() is in the DLL, it shouldn't pose problems( 
>atleast I think so ).
>

Phil Daley          Relay Technology
http://www.conknet.com/~p_daley


-----From: Roma 

SCS.007@mch.scn.de wrote:
> 
> Environment : VC++ 1.52, Windows 3.11
> 
> Hi!,
> 
> I am having a problem with CAsyncSocket. The scenario is this.
> 
>      |------------|           |------------|
>      |userapp.exe |           | initialiser|
>      |            |           |            |
>      |------------|           |------------|
>           |                       |
> sendFile()|                       | InitialiseServices()
>           |                       |
>           |     |------------|    |
>           |---->|     DLL    |<---|
>                 |            |
>                 |------------|
> 

If I got you right, 'initializer' is a separate application, right?
Than, when you call InitializeServices from the DLL, AfxSocketInit() is
called
(and thus initialize sockets usage) for the 'initializer' application,
not for the 
'userapp' application, because DLL functions are working in the process
space of the 
calling application.
You have to call your InitializeService from the userapp.exe.

Hope this helps.

-Roma Guralnik




| Вернуться в корень Архива |