![]() |
CAsyncSocket | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Class |
Declared in: AsyncSocket.h |
Copyright (c) 2000-2003 Barak Weichselbaum <barak@komodia.com> All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Contact info:
Site: http://www.komodia.com Main contact: barak@komodia.com For custom projects, consulting, or other paid services: sales@komodia.com
![]() |
virtual | CSpoofBase |
![]() |
CSocketThreadManager::TimerID | m_aDeleteTimerID | Our delete timer |
![]() |
static SocketMap | m_aSocketMap | Our list of sockets |
![]() |
CSocketThreadManager::TimerID | m_aTimerID | Our timer |
![]() |
BOOL | m_bBlocking | Are we blocking |
![]() |
BOOL | m_bClosing | Are we gonna close |
![]() |
BOOL | m_bFreeze | Should we freeze this thread ? |
![]() |
static BOOL | m_bInitialized | Are we initialized |
![]() |
BOOL | m_bList | Are we in the list |
![]() |
static BOOL | m_bShuttingDown | Are we shutting down? |
![]() |
BOOL | m_bTimeout | Timeout indicator |
![]() |
static BOOL | m_bWindow | Do we have a window handle |
![]() |
static HINSTANCE | m_hInstance | Instance of our window |
![]() |
HWND | m_hLocalWindowHandle | Our window's handle |
![]() |
unsigned int | m_iMsg | The last async message setting |
![]() |
int | m_iSocketID | ID of our socket |
![]() |
long | m_lEvent | And the event |
![]() |
CBlockedBuffer * | m_pBlockedBuffer | Our blocked buffer |
![]() |
static CGenericCriticalSection * | m_pCSection | Our global CS |
![]() |
CSocketThreadManager * | m_pLocalThreadManager | Our local thread manager (to allow custom thread mangement) |
![]() |
static CSocketThreadManager * | m_pThreadManager | Our thread manager (global) |
![]() |
unsigned char | m_ucEvents | Events to disable |
![]() |
|||
![]() |
CAsyncSocket( const CAsyncSocket& rSocket ) |
No copy Ctor | |
![]() |
Ctor and Dtor |
![]() |
|||
![]() |
virtual |
![]() |
void | Add the socket to the list | |
![]() |
void | Allocate ourself a window | |
![]() |
void | AllowBlockedBuffer( BOOL bAllow ) |
Enable/disable blocked buffer (for when sends has to wait) |
![]() |
BOOL | Block() |
Just block |
![]() |
void | ||
![]() |
BOOL | CheckAsyncSocketValid() const |
Check if the socket is valid |
![]() |
void | Remove from thread info | |
![]() |
virtual void | Delete an async socket in his own thread | |
![]() |
virtual void | DeleteSocketFromThread( DWORD dwTimeToWait ) |
Delete an async socket in his own thread |
![]() |
static void | DeleteTimerProc( LPVOID lpData ) |
Our delete proc |
![]() |
BOOL | Disable the async notification | |
![]() |
void | DisableEvents( unsigned char ucEvents ) |
Disable events |
![]() |
void | Force a receive event | |
![]() |
void | Notify that don't select this thread after socket destruction | |
![]() |
virtual SOCKET | GetAsyncHandle() const=0 |
Get the socket handle |
![]() |
CBlockedBuffer * | GetBlockedBuffer() const |
Get the blocked buffer |
![]() |
static HINSTANCE | Get the instance of our APP | |
![]() |
static CAsyncSocket * | GetSocketByID( int iSockID ) |
Find a socket |
![]() |
int | GetSocketID() const |
Get the ID of the socket |
![]() |
static CSocketThreadManager * | Get the socket thread manager | |
![]() |
CSocketThreadManager * | GetThreadManager() const |
Get our thread manager (global or local) |
![]() |
HWND | GetWindowHandle() const |
Get the handle of the window |
![]() |
BOOL | HasSystemTimer() const |
Do we have a system timer |
![]() |
BOOL | HasTimeout() const |
Do we have a timeout |
![]() |
static void | Initialize all the handlers Can be called by user, but will be invoked automatically | |
![]() |
int | InternalWSAAsyncSelect( unsigned int wMsg, long lEvent ) |
Save the last blocking status |
![]() |
BOOL | IsBlocking() const |
Are we in blocking mode |
![]() |
BOOL | IsClosing() const |
Are we closing ? |
![]() |
BOOL | IsTimeout() const |
Do we have a timeout |
![]() |
BOOL | Kill the system timer | |
![]() |
BOOL | Disable the timeout | |
![]() |
virtual BOOL | OnSocketAccept( int iErrorCode )=0 |
When a socket can accept an incoming connection |
![]() |
virtual BOOL | OnSocketClose( int iErrorCode )=0 |
When a socket was closed |
![]() |
virtual BOOL | OnSocketConnect( int iErrorCode )=0 |
When a socket got a connect event (after calling connect) |
![]() |
virtual void | Delete an async socket in his own thread Not for user to override | |
![]() |
virtual BOOL | OnSocketOOB( int iErrorCode )=0 |
When an OOB data came (however uses this feature shouldn't be doing it) |
![]() |
virtual BOOL | OnSocketReceive( int iErrorCode )=0 |
When socket has data in queue |
![]() |
virtual BOOL | OnSocketTimeout()=0 |
Messaging methods |
![]() |
virtual BOOL | OnSocketWrite( int iErrorCode )=0 |
When a send failed because it would block this event signals the send can be reattempted |
![]() |
CAsyncSocket & | operator =( const CAsyncSocket& rSocket ) |
No assignment operator |
![]() |
virtual BOOL | ReAsync() |
Go back to async mode |
![]() |
virtual BOOL | ReBlock() |
Transfer the socket back to blocking mode! |
![]() |
static BOOL | Register our window | |
![]() |
static BOOL | Remove the handlers | |
![]() |
void | Remove the socket from the list | |
![]() |
virtual BOOL | SendBlockedBuffer( const CBlockedBuffer::CBlockedData& rData ) |
Send data from the send buffer |
![]() |
virtual BOOL | SetAsync()=0 |
Go to async regular mode |
![]() |
static BOOL | Create our handlers | |
![]() |
static void | SetInstance( HINSTANCE hInst ) |
Set the instace of our app Required for Win9X |
![]() |
BOOL | SetSystemTimeout( int iMS ) |
Set a system timer |
![]() |
BOOL | SetTimeout( int iMs ) |
Create a timeout Another call to SetTimeout will reset the old timer and create a new one |
![]() |
static void | Shutdown() |
Indicate a system shutdown Can be called by user, but will be invoked automatically |
![]() |
static void | Implement a message map | |
![]() |
static void | SimpleMessageMap( DWORD dwRunTimeMS ) |
Implement a timed message map |
![]() |
static void | SimpleMessageMap( LPMapProc pProc, BOOL bStopWhenTRUE, DWORD dwSleep ) |
Implement a message map Stop it when function has a result pProc - The proc to run bStopWhenTRUE - Stop when the proc is TRUE dwSleep - How much to sleep between idle calls |
![]() |
static char | SimpleMessageMapKey( DWORD dwSleep ) |
Message map that exists when a key is pressed |
![]() |
virtual BOOL | SocketClosed( int iErrorCode ) |
Socket it closed Not for user to override |
![]() |
void | Close the timeout if needed | |
![]() |
virtual BOOL | SocketConnected( int iErrorCode ) |
Socket is connected Not for user to override |
![]() |
virtual void | We have a new socket Not for user to override | |
![]() |
static LRESULT CALLBACK | SocketMessageHandler( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) |
Our window proc |
![]() |
virtual BOOL | SocketWrite( int iErrorCode ) |
When we have data to write Not for user to override |
![]() |
virtual void | When we have a system timeout Not for user to override | |
![]() |
static void | SystemTimerProc( LPVOID lpData ) |
Our proc |
SocketThreadManager.h | |
SpoofBase.h | |
BlockedBuffer.h | |
map |
stdafx.h | for precompiled header directive |
AsyncSocket.h | |
ErrorHandlerMacros.h | |
OSManager.h | |
GenericCriticalSection.h | |
conio.h | |
vector |
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |