2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
24 /*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
25 /*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
26 /*%% (c) Copyright 1993, 1994 Novell, Inc. */
27 /*%% $XConsortium: mp_stream_socket.h /main/3 1995/10/23 10:29:57 rswiston $ */
31 * Copyright (c) 1990 by Sun Microsystems, Inc.
33 * This file implements the _Tt_stream_socket which is an object used to
34 * deal with TCP sockets. The methods for this object handle creation,
35 * destruction and communicating over TCP sockets. Note that the
36 * implementation of stream sockets is tailored specifically to the use
37 * of sockets by the MP as a signalling mechanism. The methods here are
38 * not intended to be a general C++ wrapper for sockets.
40 #ifndef MP_STREAM_SOCKET_H
41 #define MP_STREAM_SOCKET_H
42 #include <sys/types.h>
43 #include <tt_options.h>
48 #include <netinet/in.h>
49 #include <util/tt_object.h>
50 #include <util/tt_ptr.h>
51 #include <util/tt_host_utils.h>
53 class _Tt_stream_socket : public _Tt_object {
56 _Tt_stream_socket(_Tt_host_ptr &host, int port);
57 virtual ~_Tt_stream_socket();
58 int init(int init_as_source);
59 int send(char *msg, int len);
60 int recv(char *msg, int len);
64 int read_would_block();
71 sockaddr_in _hostaddr;
79 #endif /* MP_STREAM_SOCKET_H */