home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oclsrc15.zip / OCL / Include / OIP_Server.hpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  3KB  |  82 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1996
  3. // (c) 1982, 1985, 1986 Regents of the University of California.
  4. // All Rights Reserved
  5. // OIP_Server.hpp
  6.  
  7. /*
  8.  * Redistribution and use in source and binary forms, with or without
  9.  * modification, are permitted provided that the following conditions
  10.  * are met:
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  14.  *    endorse or promote products derived from this software
  15.  *    without specific prior written permission.
  16.  * 3. See OCL.INF for a detailed copyright notice.
  17.  *
  18.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  19.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  21.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  22.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  24.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  25.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  26.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  27.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28.  * SUCH DAMAGE.
  29.  */
  30.  
  31. // $Header: W:/Projects/OCL/Include/rcs/OIP_Server.hpp 1.50 1996/08/11 23:47:16 B.STEIN Release $
  32.  
  33.  
  34. #ifndef OIP_SERVER_INCLUDED
  35.    #define OIP_SERVER_INCLUDED
  36.  
  37. #ifndef OIP_CLISOCKET_INCLUDED
  38.    #include <OIP_CliSocket.hpp>
  39. #endif
  40.  
  41. #ifndef OIP_SRVSOCKET_INCLUDED
  42.    #include <OIP_SrvSocket.hpp>
  43. #endif
  44.  
  45.  
  46. typedef class OIP_Server *pOIP_Server;
  47.  
  48.  
  49. class __CPP_EXPORT__ OIP_Server
  50.   : public OCLObject
  51. {
  52.  protected:
  53.     BOOL                active;
  54.     USHORT              port;
  55.     OIP_SrvSocket    server;
  56.     OIP_CliSocket    client;
  57.  
  58.  public:
  59.  
  60.        OIP_Server       ();
  61.   
  62.     virtual
  63.        ~OIP_Server      ();
  64.  
  65.     virtual PSZ
  66.        isOfType         () const; 
  67.  
  68.     OIP_Server
  69.        &init            (USHORT _port),
  70.        &terminate       (),  
  71.        &waitForClient   (),
  72.        &connectMsg      (),  
  73.        &disconnect      (),
  74.        &disconnectMsg   (),
  75.        &send            (PVOID data, ULONG size),
  76.        &sendSuccess     (),   
  77.        &sendEnd         (),   
  78.        &recv            (PVOID data, ULONG size);
  79. };
  80.  
  81. #endif // OIP_SERVER_INCLUDED 
  82.