3 * MICO --- an Open Source CORBA implementation
4 * Copyright (c) 1997-2001 by The Mico Team
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * For more information, visit the MICO Home Page at
21 * http://www.mico.org/
24 #ifndef __mico_transport_udp_h__
25 #define __mico_transport_udp_h__
29 class UDPTransport : public SocketTransport {
31 InetAddress local_addr, peer_addr;
33 CORBA::Boolean is_established;
34 CORBA::Boolean is_connected;
35 CORBA::Boolean is_bound;
36 struct sockaddr_in *peer_sin, *addr_sin;
38 CORBA::Long collect_replies (CORBA::Long tmout);
43 CORBA::Boolean bind (const CORBA::Address *);
44 CORBA::Boolean connect (const CORBA::Address *);
46 void open(CORBA::Long fd = -1);
49 CORBA::Long read (void *, CORBA::Long len);
50 CORBA::Long write (const void *, CORBA::Long len);
52 const CORBA::Address *addr ();
53 const CORBA::Address *peer ();
55 CORBA::Boolean bind_server (const CORBA::Address *);
56 CORBA::Boolean connect_server (const CORBA::Address *);
57 CORBA::Long read_dgram (CORBA::Buffer &buf);
61 class UDPTransportServer : public SocketTransportServer {
63 InetAddress local_addr;
64 CORBA::Boolean is_bound;
65 struct sockaddr_in *addr_sin;
69 UDPTransportServer ();
71 CORBA::Boolean bind (const CORBA::Address *);
74 CORBA::Transport *accept ();
75 const CORBA::Address *addr ();
81 #endif // __mico_transport_udp_h__