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

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


CAsyncSocket problem

Jose L. Carles -- cove@jet.es
Tuesday, July 23, 1996

Enviroment: VC++ 4.1, NT 4.0

Hi,

  I'm deriving a class from CAsyncSocket and overriding the notification messages, especially
OnSend(), but I'm having troubles with this callback. When I do a Connect() I receive one OnSend()
and one OnConnect() notifications (in that order) but while I'm receiving OnReceive() and OnClose()
I never receive OnSend() after doing a Send().

  I'm going to test the program on Windows 95.

  Has anybody any idea about this? Am I forgetting anything?

  TIA,

     Carles




pierardi@pumatech.com
Friday, July 26, 1996


     
     
     Carles,
     
     
     I suggest that you begin by keeping in mind that a CAsyncSocket is a 
     wrapper for a "socket" that has been registered for WSAAsyncSelect for 
     all events. Therefore the MFC event handlers should mimick the 
     WSAAyncSelect callback paradigm.  There are some nuiances when dealing 
     with WSAAsyncSelect such as expecting FD_READs or OnRead() events that
     are not necessarily occurring at the correct time.  Your application
     will have to gate reactions to such events by adding a flag or 
     semaphore.
     
     A good reference is a book by Quinn and Shute's Windows Sockets 
     Network Programming, ISBN 0-201-63372-8. 
     
     Good Luck !
     
     
     Peter
     


______________________________ Reply Separator _________________________________
Subject: CAsyncSocket problem
Author:  mfc-l@netcom.netcom.com at Internet
Date:    7/26/96 3:04 AM


Enviroment: VC++ 4.1, NT 4.0
     
Hi,
     
  I'm deriving a class from CAsyncSocket and overriding the notification 
  messages
, especially
OnSend(), but I'm having troubles with this callback. When I do a Connect() I 
rec eive one OnSend()
and one OnConnect() notifications (in that order) but while I'm receiving 
OnRecei ve() and OnClose()
I never receive OnSend() after doing a Send().
     
  I'm going to test the program on Windows 95.
     
  Has anybody any idea about this? Am I forgetting anything?
     
  TIA,
     
     Carles
     




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