xref: /trunk/main/automation/source/simplecm/tcpio.hxx (revision b3897e6aa10c44e4a3a28a6e1f45e38816be3d7f)
13398c5b8SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
33398c5b8SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
43398c5b8SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
53398c5b8SAndrew Rist  * distributed with this work for additional information
63398c5b8SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
73398c5b8SAndrew Rist  * to you under the Apache License, Version 2.0 (the
83398c5b8SAndrew Rist  * "License"); you may not use this file except in compliance
93398c5b8SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
113398c5b8SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
133398c5b8SAndrew Rist  * Unless required by applicable law or agreed to in writing,
143398c5b8SAndrew Rist  * software distributed under the License is distributed on an
153398c5b8SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
163398c5b8SAndrew Rist  * KIND, either express or implied.  See the License for the
173398c5b8SAndrew Rist  * specific language governing permissions and limitations
183398c5b8SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
203398c5b8SAndrew Rist  *************************************************************/
213398c5b8SAndrew Rist 
22cdf0e10cSrcweir #ifndef TCPIO_HXX
23cdf0e10cSrcweir #define TCPIO_HXX
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #include <vos/socket.hxx>
26cdf0e10cSrcweir #include <vos/mutex.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include "communiio.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir class TCPIO : public ITransmiter, public IReceiver
31cdf0e10cSrcweir {
32cdf0e10cSrcweir private:
33cdf0e10cSrcweir     vos::OStreamSocket *pStreamSocket;
34cdf0e10cSrcweir     vos::OMutex aMSocketReadAccess;
35cdf0e10cSrcweir     vos::OMutex aMSocketWriteAccess;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir public:
38cdf0e10cSrcweir 
39*b3897e6aSmseidel     //
TCPIO(vos::OStreamSocket * pSocket)40cdf0e10cSrcweir     TCPIO( vos::OStreamSocket *pSocket ):pStreamSocket( pSocket ){}
~TCPIO()41cdf0e10cSrcweir     virtual ~TCPIO(){}
42cdf0e10cSrcweir 
43*b3897e6aSmseidel     // implement ITransmiter
44cdf0e10cSrcweir     virtual comm_USHORT TransferBytes( const void* pBuffer, comm_UINT32 nLen );
45cdf0e10cSrcweir 
46*b3897e6aSmseidel     // implement IReceiver
47cdf0e10cSrcweir     virtual comm_USHORT ReceiveBytes( void* pBuffer, comm_UINT32 nLen );
48cdf0e10cSrcweir 
49cdf0e10cSrcweir     // helper
50cdf0e10cSrcweir     void SetStreamSocket( vos::OStreamSocket *pSocket );
51cdf0e10cSrcweir 
52cdf0e10cSrcweir };
53cdf0e10cSrcweir 
54cdf0e10cSrcweir #endif
55*b3897e6aSmseidel 
56*b3897e6aSmseidel /* vim: set noet sw=4 ts=4: */
57