2 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
5 ACE_ATM_Stream::dump () const
7 #if defined (ACE_HAS_DUMP)
8 ACE_TRACE ("ACE_ATM_Stream::dump");
9 #endif /* ACE_HAS_DUMP */
13 ACE_ATM_Stream::ACE_ATM_Stream ()
15 ACE_TRACE ("ACE_ATM_Stream::ACE_ATM_Stream");
20 ACE_ATM_Stream::open (ACE_ATM_Params params)
22 ACE_TRACE ("ACE_ATM_Stream::open");
23 #if defined (ACE_HAS_FORE_ATM_XTI)
24 ACE_HANDLE handle = stream_.open (params.get_device(),
27 return (handle == ACE_INVALID_HANDLE ? -1 : 0);
28 #elif defined (ACE_HAS_FORE_ATM_WS2)
29 params.set_flags( ACE_FLAG_MULTIPOINT_C_ROOT | ACE_FLAG_MULTIPOINT_D_ROOT );
31 int retval = stream_.open (params.get_type(),
32 params.get_protocol_family(),
33 params.get_protocol(),
34 params.get_protocol_info(),
35 params.get_sock_group(),
37 params.get_reuse_addr());
41 struct sockaddr_atm sock_addr;
43 ACE_OS::memset(&sock_addr, 0, sizeof(struct sockaddr_atm));
44 sock_addr.satm_family = AF_ATM;
45 sock_addr.satm_number.AddressType=ADDR_ANY;
46 sock_addr.satm_number.NumofDigits = ATM_ADDR_SIZE;
47 sock_addr.satm_blli.Layer2Protocol = SAP_FIELD_ABSENT;
48 sock_addr.satm_blli.Layer3Protocol = SAP_FIELD_ABSENT;
49 sock_addr.satm_bhli.HighLayerInfoType = SAP_FIELD_ABSENT;
50 if (ACE_OS::bind(get_handle(),
51 (struct sockaddr FAR *)&sock_addr,
52 sizeof(struct sockaddr_atm)) < 0)
54 ACE_OS::printf("Error binding local address: %d",WSAGetLastError());
60 ACE_UNUSED_ARG(params);
62 #endif /* ACE_HAS_FORE_ATM_XTI */
67 ACE_ATM_Stream::close ()
69 ACE_TRACE ("ACE_ATM_Stream::close");
70 #if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2)
71 return stream_.close ();
74 #endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 */
79 ACE_ATM_Stream::get_stream ()
81 ACE_TRACE ("ACE_ATM_Stream::get_stream");
87 ACE_ATM_Stream::recv (void *buf,
91 ACE_TRACE ("ACE_ATM_Stream::recv");
92 #if defined (ACE_HAS_FORE_ATM_XTI)
93 return stream_.recv (buf,
96 #elif defined (ACE_HAS_FORE_ATM_WS2)
97 return stream_.recv (buf,
102 ACE_UNUSED_ARG(flags);
104 #endif /* ACE_HAS_FORE_ATM_XTI */
109 ACE_ATM_Stream::send_n (const void *buf,
113 ACE_TRACE ("ACE_ATM_Stream::send_n");
114 #if defined (ACE_HAS_FORE_ATM_XTI)
115 return stream_.send_n (buf,
118 #elif defined (ACE_HAS_FORE_ATM_WS2)
119 return stream_.send_n (buf,
125 ACE_UNUSED_ARG(flags);
127 #endif /* ACE_HAS_FORE_ATM_XTI */
130 ACE_END_VERSIONED_NAMESPACE_DECL