Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
reporting
socket.hpp
Go to the documentation of this file.
1
/***************************************************************************
2
3
Socket.h - Small socket wrapper
4
-------------------
5
begin : Fri Aug 4 2006
6
copyright : (C) 2006 Bas Kemper
7
email : kst@ <my name> .be
8
9
***************************************************************************
10
* This library is free software; you can redistribute it and/or *
11
* modify it under the terms of the GNU Lesser General Public *
12
* License as published by the Free Software Foundation; either *
13
* version 2.1 of the License, or (at your option) any later version. *
14
* *
15
* This library is distributed in the hope that it will be useful, *
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
18
* Lesser General Public License for more details. *
19
* *
20
* You should have received a copy of the GNU Lesser General Public *
21
* License along with this library; if not, write to the Free Software *
22
* Foundation, Inc., 59 Temple Place, *
23
* Suite 330, Boston, MA 02111-1307 USA *
24
* *
25
***************************************************************************/
26
#ifndef ORO_COMP_SOCKET_H
27
#define ORO_COMP_SOCKET_H
28
#include <iostream>
29
30
namespace
{
31
class
sockbuf;
32
}
33
34
namespace
OCL
{
35
namespace
TCP {
36
class
Socket
:
public
std::ostream {
37
friend
class ::sockbuf;
38
private
:
42
int
socket
;
43
52
bool
lineAvailable
();
53
58
void
checkBufferOverflow
();
59
63
void
rawClose
();
64
68
/* buflength should be at least msglength * 2 in order to avoid problems with memcpy! */
69
#define BUFLENGTH 2000
70
char
buffer
[
BUFLENGTH
];
71
int
begin
;
72
int
ptrpos
;
73
int
end
;
74
75
public
:
81
Socket
(
int
socketID );
82
~Socket
();
83
87
bool
isValid
()
const
;
88
92
bool
dataAvailable
();
93
97
std::string
readLine
();
98
102
void
close
();
103
};
104
}
// namespace TCP
105
}
// namespace OCL
106
#endif
BUFLENGTH
#define BUFLENGTH
Definition:
socket.hpp:69
OCL::TCP::Socket::end
int end
Definition:
socket.hpp:73
OCL::TCP::Socket::lineAvailable
bool lineAvailable()
Definition:
socket.cpp:166
OCL::TCP::Socket::~Socket
~Socket()
Definition:
socket.cpp:148
OCL::TCP::Socket::close
void close()
Definition:
socket.cpp:278
OCL::TCP::Socket::readLine
std::string readLine()
Definition:
socket.cpp:222
OCL::TCP::Socket::begin
int begin
Definition:
socket.hpp:71
OCL::TCP::Socket
Definition:
socket.hpp:36
OCL::TCP::Socket::dataAvailable
bool dataAvailable()
Definition:
socket.cpp:161
OCL
Definition:
deployer-funcs.cpp:68
OCL::TCP::Socket::checkBufferOverflow
void checkBufferOverflow()
Definition:
socket.cpp:207
OCL::TCP::Socket::socket
int socket
Definition:
socket.hpp:42
OCL::TCP::Socket::rawClose
void rawClose()
Definition:
socket.cpp:268
OCL::TCP::Socket::Socket
Socket(int socketID)
Definition:
socket.cpp:141
OCL::TCP::Socket::buffer
char buffer[BUFLENGTH]
Definition:
socket.hpp:70
OCL::TCP::Socket::isValid
bool isValid() const
Definition:
socket.cpp:156
OCL::TCP::Socket::ptrpos
int ptrpos
Definition:
socket.hpp:72
ocl
Author(s): OCL Development Team
autogenerated on Mon Mar 23 2020 04:47:19