Class CAsyncSocket Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: Custom Code in Header Private SectionNext page: m_bFreeze    Show member index
Class Declared in:
AsyncSocket.h

'Overview' icon -- Shortcut to top of page. Overview

Copyright (c) 2000 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 Email: barak@komodia.com

Hierarchy Chart Hierarchy Chart

'Base Classes' icon -- Shortcut to top of page. Base Classes

Protected base class CSpoofBase

'Data Items' icon -- Shortcut to top of page. Data Items

Private data BOOL m_bFreeze Should we freeze this thread ?
Private data static BOOL m_bShuttingDown Are we shutting down
Private data HWND m_hLocalWindowHandle Our window's handle
Private data static BOOL m_Initialized Are we initialized
Private data static HINSTANCE m_Instance Instance of our window
Private data BOOL m_List Are we in the list
Private data CSocketThreadManager * m_pLocalThreadManager Our local thread manager (to allow custom thread mangement)
Private data static CSocketThreadManager * m_pThreadManager Our thread manager (global)
Private data int m_SocketID ID of our socket
Private data static SocketMap m_SocketMap Our list of sockets
Private data BOOL m_Timeout Timeout indicator
Private data static BOOL m_Window Construction/Destruction
Private data static HWND m_WindowHandle Our window's handle

'Constructors' icon -- Shortcut to top of page. Constructors

Private constructor

CAsyncShutdown::CAsyncShutdown()

Public constructor

CAsyncSocket()

ctor and dtor

'Destructors' icon -- Shortcut to top of page. Destructors

Private destructor

CAsyncShutdown::~CAsyncShutdown()

Public destructor virtual

~CAsyncSocket()

'Functions' icon -- Shortcut to top of page. Functions

Protected function void

AddSocketToList()

Add the socket to the list
Private function void

AllocateHandle()

Allocate ourself a window
Private function void

CAsyncShutdown::NotifyShutdown()

Private function BOOL

CheckAsyncSocketValid() const

Check if the socket is valid
Private function void

DeAllocateHandle()

Remove from thread info
Public function BOOL

DisableAsync()

Disable the async notification
Public function void

FreezeThread()

Notify that don't select this thread after socket destruction
Protected function virtual SOCKET

GetAsyncHandle() const=0

Get the socket handle
Private function static HINSTANCE

GetInstance()

Get the instance of our APP
Private function static CAsyncSocket *

GetSocketByID( int iSockID )

Find a socket
Protected function int

GetSocketID() const

Get the ID of the socket
Private function CSocketThreadManager *

GetThreadManager() const

Get our thread manager (global or local)
Protected function HWND

GetWindowHandle() const

Get the handle of the window
Public function static void

Initialize()

Initialize all the handlers
Protected function BOOL

IsTimeout() const

Do we have a timeout
Public function BOOL

KillTimer()

Disable the time
Protected function virtual BOOL

OnSocketAccept( int iErrorCode )=0

Protected function virtual BOOL

OnSocketClose( int iErrorCode )=0

Protected function virtual BOOL

OnSocketConnect( int iErrorCode )=0

Protected function virtual BOOL

OnSocketOOB( int iErrorCode )=0

Protected function virtual BOOL

OnSocketReceive( int iErrorCode )=0

Protected function virtual BOOL

OnSocketTimeout()=0

Messaging methods
Protected function virtual BOOL

OnSocketWrite( int iErrorCode )=0

Private function static BOOL

RegisterWindow()

Register our window
Private function static BOOL

RemoveHandlers()

Remove the handlers
Protected function void

RemoveSocketFromList()

Remove the socket from the list
Protected function virtual BOOL

SetAsync()=0

Go to async regular mode
Private function static BOOL

SetHandlers()

Create our handlers
Public function static void

SetInstance( HINSTANCE hInst )

Set the instace of our app
Public function BOOL

SetTimeout( int iMs )

Create a timeout
Public function static void

Shutdown()

Indicate a system shutdown
Protected function void

SocketClosing()

Close the timeout if needed
Private function static LRESULT CALLBACK

SocketMessageHandler( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )

Our window proc

'Custom Code' icon -- Shortcut to top of page. Custom Code

'Implementation Details' icon -- Shortcut to top of page. Implementation Details

File(s)
C:\dev\Komodia\AsyncSocket.cpp
C:\dev\Komodia\AsyncSocket.h
Header Includes
SpoofBase.h     
map     
Source Includes
stdafx.h     for precompiled header directive
AsyncSocket.h     
SocketThreadManager.h     
Owner
LibV3
Last Modified
26-Jun-01 3:07:01 PM

Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 27 Jun 2001.