~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to php/src/IcePHP/Connection.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// **********************************************************************
 
2
//
 
3
// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
 
4
//
 
5
// This copy of Ice is licensed to you under the terms described in the
 
6
// ICE_LICENSE file included in this distribution.
 
7
//
 
8
// **********************************************************************
 
9
 
 
10
#include <Connection.h>
 
11
#include <Endpoint.h>
 
12
#include <Util.h>
 
13
 
 
14
using namespace std;
 
15
using namespace IcePHP;
 
16
 
 
17
ZEND_EXTERN_MODULE_GLOBALS(ice)
 
18
 
 
19
//
 
20
// Class entries represent the PHP class implementations we have registered.
 
21
//
 
22
static zend_class_entry* connectionClassEntry = 0;
 
23
 
 
24
static zend_class_entry* connectionInfoClassEntry = 0;
 
25
static zend_class_entry* ipConnectionInfoClassEntry = 0;
 
26
static zend_class_entry* tcpConnectionInfoClassEntry = 0;
 
27
static zend_class_entry* udpConnectionInfoClassEntry = 0;
 
28
 
 
29
//
 
30
// Ice::Connection support.
 
31
//
 
32
static zend_object_handlers _connectionHandlers;
 
33
static zend_object_handlers _connectionInfoHandlers;
 
34
 
 
35
extern "C"
 
36
{
 
37
static zend_object_value handleConnectionAlloc(zend_class_entry* TSRMLS_DC);
 
38
static void handleConnectionFreeStorage(void* TSRMLS_DC);
 
39
static int handleConnectionCompare(zval*, zval* TSRMLS_DC);
 
40
 
 
41
static zend_object_value handleConnectionInfoAlloc(zend_class_entry* TSRMLS_DC);
 
42
static void handleConnectionInfoFreeStorage(void* TSRMLS_DC);
 
43
}
 
44
 
 
45
ZEND_METHOD(Ice_Connection, __construct)
 
46
{
 
47
    runtimeError("Connection cannot be instantiated" TSRMLS_CC);
 
48
}
 
49
 
 
50
ZEND_METHOD(Ice_Connection, __toString)
 
51
{
 
52
    if(ZEND_NUM_ARGS() > 0)
 
53
    {
 
54
        WRONG_PARAM_COUNT;
 
55
    }
 
56
 
 
57
    Ice::ConnectionPtr _this = Wrapper<Ice::ConnectionPtr>::value(getThis() TSRMLS_CC);
 
58
    assert(_this);
 
59
 
 
60
    try
 
61
    {
 
62
        string str = _this->toString();
 
63
        RETURN_STRINGL(STRCAST(str.c_str()), str.length(), 1);
 
64
    }
 
65
    catch(const IceUtil::Exception& ex)
 
66
    {
 
67
        throwException(ex TSRMLS_CC);
 
68
        RETURN_NULL();
 
69
    }
 
70
}
 
71
 
 
72
ZEND_METHOD(Ice_Connection, close)
 
73
{
 
74
    Ice::ConnectionPtr _this = Wrapper<Ice::ConnectionPtr>::value(getThis() TSRMLS_CC);
 
75
    assert(_this);
 
76
 
 
77
    zend_bool b;
 
78
    if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, const_cast<char*>("b"), &b TSRMLS_CC) != SUCCESS)
 
79
    {
 
80
        RETURN_NULL();
 
81
    }
 
82
 
 
83
    try
 
84
    {
 
85
        _this->close(b ? true : false);
 
86
    }
 
87
    catch(const IceUtil::Exception& ex)
 
88
    {
 
89
        throwException(ex TSRMLS_CC);
 
90
        RETURN_NULL();
 
91
    }
 
92
}
 
93
 
 
94
ZEND_METHOD(Ice_Connection, getEndpoint)
 
95
{
 
96
    if(ZEND_NUM_ARGS() > 0)
 
97
    {
 
98
        WRONG_PARAM_COUNT;
 
99
    }
 
100
 
 
101
    Ice::ConnectionPtr _this = Wrapper<Ice::ConnectionPtr>::value(getThis() TSRMLS_CC);
 
102
    assert(_this);
 
103
 
 
104
    try
 
105
    {
 
106
        if(!createEndpoint(return_value, _this->getEndpoint() TSRMLS_CC))
 
107
        {
 
108
            RETURN_NULL();
 
109
        }
 
110
    }
 
111
    catch(const IceUtil::Exception& ex)
 
112
    {
 
113
        throwException(ex TSRMLS_CC);
 
114
        RETURN_NULL();
 
115
    }
 
116
}
 
117
 
 
118
ZEND_METHOD(Ice_Connection, flushBatchRequests)
 
119
{
 
120
    if(ZEND_NUM_ARGS() > 0)
 
121
    {
 
122
        WRONG_PARAM_COUNT;
 
123
    }
 
124
 
 
125
    Ice::ConnectionPtr _this = Wrapper<Ice::ConnectionPtr>::value(getThis() TSRMLS_CC);
 
126
    assert(_this);
 
127
 
 
128
    try
 
129
    {
 
130
        _this->flushBatchRequests();
 
131
    }
 
132
    catch(const IceUtil::Exception& ex)
 
133
    {
 
134
        throwException(ex TSRMLS_CC);
 
135
        RETURN_NULL();
 
136
    }
 
137
}
 
138
 
 
139
ZEND_METHOD(Ice_Connection, type)
 
140
{
 
141
    if(ZEND_NUM_ARGS() > 0)
 
142
    {
 
143
        WRONG_PARAM_COUNT;
 
144
    }
 
145
 
 
146
    Ice::ConnectionPtr _this = Wrapper<Ice::ConnectionPtr>::value(getThis() TSRMLS_CC);
 
147
    assert(_this);
 
148
 
 
149
    try
 
150
    {
 
151
        string str = _this->type();
 
152
        RETURN_STRINGL(STRCAST(str.c_str()), str.length(), 1);
 
153
    }
 
154
    catch(const IceUtil::Exception& ex)
 
155
    {
 
156
        throwException(ex TSRMLS_CC);
 
157
        RETURN_NULL();
 
158
    }
 
159
}
 
160
 
 
161
ZEND_METHOD(Ice_Connection, timeout)
 
162
{
 
163
    if(ZEND_NUM_ARGS() != 0)
 
164
    {
 
165
        WRONG_PARAM_COUNT;
 
166
    }
 
167
 
 
168
    Ice::ConnectionPtr _this = Wrapper<Ice::ConnectionPtr>::value(getThis() TSRMLS_CC);
 
169
    assert(_this);
 
170
 
 
171
    try
 
172
    {
 
173
        Ice::Int timeout = _this->timeout();
 
174
        ZVAL_LONG(return_value, static_cast<long>(timeout));
 
175
    }
 
176
    catch(const IceUtil::Exception& ex)
 
177
    {
 
178
        throwException(ex TSRMLS_CC);
 
179
        RETURN_NULL();
 
180
    }
 
181
}
 
182
 
 
183
ZEND_METHOD(Ice_Connection, toString)
 
184
{
 
185
    ZEND_MN(Ice_Connection___toString)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
 
186
}
 
187
 
 
188
ZEND_METHOD(Ice_Connection, getInfo)
 
189
{
 
190
    if(ZEND_NUM_ARGS() != 0)
 
191
    {
 
192
        WRONG_PARAM_COUNT;
 
193
    }
 
194
 
 
195
    Ice::ConnectionPtr _this = Wrapper<Ice::ConnectionPtr>::value(getThis() TSRMLS_CC);
 
196
    assert(_this);
 
197
 
 
198
    try
 
199
    {
 
200
        Ice::ConnectionInfoPtr info = _this->getInfo();
 
201
        if(!createConnectionInfo(return_value, _this->getInfo() TSRMLS_CC))
 
202
        {
 
203
            RETURN_NULL();
 
204
        }
 
205
    }
 
206
    catch(const IceUtil::Exception& ex)
 
207
    {
 
208
        throwException(ex TSRMLS_CC);
 
209
        RETURN_NULL();
 
210
    }
 
211
}
 
212
 
 
213
#ifdef _WIN32
 
214
extern "C"
 
215
#endif
 
216
static zend_object_value
 
217
handleConnectionAlloc(zend_class_entry* ce TSRMLS_DC)
 
218
{
 
219
    zend_object_value result;
 
220
 
 
221
    Wrapper<Ice::ConnectionPtr>* obj = Wrapper<Ice::ConnectionPtr>::create(ce TSRMLS_CC);
 
222
    assert(obj);
 
223
 
 
224
    result.handle = zend_objects_store_put(obj, 0, (zend_objects_free_object_storage_t)handleConnectionFreeStorage,
 
225
                                           0 TSRMLS_CC);
 
226
    result.handlers = &_connectionHandlers;
 
227
 
 
228
    return result;
 
229
}
 
230
 
 
231
#ifdef _WIN32
 
232
extern "C"
 
233
#endif
 
234
static void
 
235
handleConnectionFreeStorage(void* p TSRMLS_DC)
 
236
{
 
237
    Wrapper<Ice::ConnectionPtr>* obj = static_cast<Wrapper<Ice::ConnectionPtr>*>(p);
 
238
    delete obj->ptr;
 
239
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
 
240
}
 
241
 
 
242
#ifdef _WIN32
 
243
extern "C"
 
244
#endif
 
245
static int
 
246
handleConnectionCompare(zval* zobj1, zval* zobj2 TSRMLS_DC)
 
247
{
 
248
    //
 
249
    // PHP guarantees that the objects have the same class.
 
250
    //
 
251
 
 
252
    Ice::ConnectionPtr con1 = Wrapper<Ice::ConnectionPtr>::value(zobj1 TSRMLS_CC);
 
253
    assert(con1);
 
254
    Ice::ConnectionPtr con2 = Wrapper<Ice::ConnectionPtr>::value(zobj2 TSRMLS_CC);
 
255
    assert(con2);
 
256
 
 
257
    if(con1 == con2)
 
258
    {
 
259
        return 0;
 
260
    }
 
261
    else if(con1 < con2)
 
262
    {
 
263
        return -1;
 
264
    }
 
265
    else
 
266
    {
 
267
        return 1;
 
268
    }
 
269
}
 
270
 
 
271
//
 
272
// Predefined methods for Connection.
 
273
//
 
274
static function_entry _interfaceMethods[] =
 
275
{
 
276
    {0, 0, 0}
 
277
};
 
278
static function_entry _connectionClassMethods[] =
 
279
{
 
280
    ZEND_ME(Ice_Connection, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
 
281
    ZEND_ME(Ice_Connection, __toString, NULL, ZEND_ACC_PUBLIC)
 
282
    ZEND_ME(Ice_Connection, close, NULL, ZEND_ACC_PUBLIC)
 
283
    ZEND_ME(Ice_Connection, getEndpoint, NULL, ZEND_ACC_PUBLIC)
 
284
    ZEND_ME(Ice_Connection, flushBatchRequests, NULL, ZEND_ACC_PUBLIC)
 
285
    ZEND_ME(Ice_Connection, type, NULL, ZEND_ACC_PUBLIC)
 
286
    ZEND_ME(Ice_Connection, timeout, NULL, ZEND_ACC_PUBLIC)
 
287
    ZEND_ME(Ice_Connection, toString, NULL, ZEND_ACC_PUBLIC)
 
288
    ZEND_ME(Ice_Connection, getInfo, NULL, ZEND_ACC_PUBLIC)
 
289
    {0, 0, 0}
 
290
};
 
291
 
 
292
ZEND_METHOD(Ice_ConnectionInfo, __construct)
 
293
{
 
294
    runtimeError("ConnectionInfo cannot be instantiated" TSRMLS_CC);
 
295
}
 
296
 
 
297
//
 
298
// Predefined methods for ConnectionInfo.
 
299
//
 
300
static function_entry _connectionInfoClassMethods[] =
 
301
{
 
302
    ZEND_ME(Ice_ConnectionInfo, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
 
303
    {0, 0, 0}
 
304
};
 
305
 
 
306
#ifdef _WIN32
 
307
extern "C"
 
308
#endif
 
309
static zend_object_value
 
310
handleConnectionInfoAlloc(zend_class_entry* ce TSRMLS_DC)
 
311
{
 
312
    zend_object_value result;
 
313
 
 
314
    Wrapper<Ice::ConnectionInfoPtr>* obj = Wrapper<Ice::ConnectionInfoPtr>::create(ce TSRMLS_CC);
 
315
    assert(obj);
 
316
 
 
317
    result.handle = zend_objects_store_put(obj, 0, (zend_objects_free_object_storage_t)handleConnectionInfoFreeStorage,
 
318
                                           0 TSRMLS_CC);
 
319
    result.handlers = &_connectionInfoHandlers;
 
320
 
 
321
    return result;
 
322
}
 
323
 
 
324
#ifdef _WIN32
 
325
extern "C"
 
326
#endif
 
327
static void
 
328
handleConnectionInfoFreeStorage(void* p TSRMLS_DC)
 
329
{
 
330
    Wrapper<Ice::ConnectionInfoPtr>* obj = static_cast<Wrapper<Ice::ConnectionInfoPtr>*>(p);
 
331
    delete obj->ptr;
 
332
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
 
333
}
 
334
 
 
335
bool
 
336
IcePHP::connectionInit(TSRMLS_D)
 
337
{
 
338
    //
 
339
    // We register an interface and a class that implements the interface. This allows
 
340
    // applications to safely include the Slice-generated code for the type.
 
341
    //
 
342
 
 
343
    //
 
344
    // Register the Connection interface.
 
345
    //
 
346
    zend_class_entry ce;
 
347
#ifdef ICEPHP_USE_NAMESPACES
 
348
    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("Connection"), _interfaceMethods);
 
349
#else
 
350
    INIT_CLASS_ENTRY(ce, "Ice_Connection", _interfaceMethods);
 
351
#endif
 
352
    zend_class_entry* interface = zend_register_internal_interface(&ce TSRMLS_CC);
 
353
 
 
354
    //
 
355
    // Register the Connection class.
 
356
    //
 
357
    INIT_CLASS_ENTRY(ce, "IcePHP_Connection", _connectionClassMethods);
 
358
    ce.create_object = handleConnectionAlloc;
 
359
    connectionClassEntry = zend_register_internal_class(&ce TSRMLS_CC);
 
360
    memcpy(&_connectionHandlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 
361
    _connectionHandlers.compare_objects = handleConnectionCompare;
 
362
    zend_class_implements(connectionClassEntry TSRMLS_CC, 1, interface);
 
363
 
 
364
    //
 
365
    // Register the ConnectionInfo class.
 
366
    //
 
367
#ifdef ICEPHP_USE_NAMESPACES
 
368
    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("ConnectionInfo"), _connectionInfoClassMethods);
 
369
#else
 
370
    INIT_CLASS_ENTRY(ce, "Ice_ConnectionInfo", _connectionInfoClassMethods);
 
371
#endif
 
372
    ce.create_object = handleConnectionInfoAlloc;
 
373
    connectionInfoClassEntry = zend_register_internal_class(&ce TSRMLS_CC);
 
374
    memcpy(&_connectionInfoHandlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 
375
    zend_declare_property_bool(connectionInfoClassEntry, STRCAST("incoming"), sizeof("incoming") - 1, 0,
 
376
                               ZEND_ACC_PUBLIC TSRMLS_CC);
 
377
    zend_declare_property_string(connectionInfoClassEntry, STRCAST("adapterName"), sizeof("adapterName") - 1,
 
378
                                 STRCAST(""), ZEND_ACC_PUBLIC TSRMLS_CC);
 
379
 
 
380
    //
 
381
    // Register the IPConnectionInfo class.
 
382
    //
 
383
#ifdef ICEPHP_USE_NAMESPACES
 
384
    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("IPConnectionInfo"), NULL);
 
385
#else
 
386
    INIT_CLASS_ENTRY(ce, "Ice_IPConnectionInfo", NULL);
 
387
#endif
 
388
    ce.create_object = handleConnectionInfoAlloc;
 
389
    ipConnectionInfoClassEntry = zend_register_internal_class_ex(&ce, connectionInfoClassEntry, NULL TSRMLS_CC);
 
390
    zend_declare_property_string(ipConnectionInfoClassEntry, STRCAST("localAddress"), sizeof("localAddress") - 1,
 
391
                                 STRCAST(""), ZEND_ACC_PUBLIC TSRMLS_CC);
 
392
    zend_declare_property_long(ipConnectionInfoClassEntry, STRCAST("localPort"), sizeof("localPort") - 1, 0,
 
393
                               ZEND_ACC_PUBLIC TSRMLS_CC);
 
394
    zend_declare_property_string(ipConnectionInfoClassEntry, STRCAST("remoteAddress"), sizeof("remoteAddress") - 1,
 
395
                                 STRCAST(""), ZEND_ACC_PUBLIC TSRMLS_CC);
 
396
    zend_declare_property_long(ipConnectionInfoClassEntry, STRCAST("remotePort"), sizeof("remotePort") - 1, 0,
 
397
                               ZEND_ACC_PUBLIC TSRMLS_CC);
 
398
 
 
399
    //
 
400
    // Register the TCPConnectionInfo class.
 
401
    //
 
402
#ifdef ICEPHP_USE_NAMESPACES
 
403
    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("TCPConnectionInfo"), NULL);
 
404
#else
 
405
    INIT_CLASS_ENTRY(ce, "Ice_TCPConnectionInfo", NULL);
 
406
#endif
 
407
    ce.create_object = handleConnectionInfoAlloc;
 
408
    tcpConnectionInfoClassEntry = zend_register_internal_class_ex(&ce, ipConnectionInfoClassEntry, NULL TSRMLS_CC);
 
409
 
 
410
    //
 
411
    // Register the UDPConnectionInfo class.
 
412
    //
 
413
#ifdef ICEPHP_USE_NAMESPACES
 
414
    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("UDPConnectionInfo"), NULL);
 
415
#else
 
416
    INIT_CLASS_ENTRY(ce, "Ice_UDPConnectionInfo", NULL);
 
417
#endif
 
418
    ce.create_object = handleConnectionInfoAlloc;
 
419
    udpConnectionInfoClassEntry = zend_register_internal_class_ex(&ce, ipConnectionInfoClassEntry, NULL TSRMLS_CC);
 
420
    zend_declare_property_string(udpConnectionInfoClassEntry, STRCAST("mcastAddress"), sizeof("mcastAddress") - 1,
 
421
                                 STRCAST(""), ZEND_ACC_PUBLIC TSRMLS_CC);
 
422
    zend_declare_property_long(udpConnectionInfoClassEntry, STRCAST("mcastPort"), sizeof("mcastPort") - 1, 0,
 
423
                               ZEND_ACC_PUBLIC TSRMLS_CC);
 
424
 
 
425
    return true;
 
426
}
 
427
 
 
428
bool
 
429
IcePHP::createConnection(zval* zv, const Ice::ConnectionPtr& p TSRMLS_DC)
 
430
{
 
431
    if(object_init_ex(zv, connectionClassEntry) != SUCCESS)
 
432
    {
 
433
        runtimeError("unable to initialize connection" TSRMLS_CC);
 
434
        return false;
 
435
    }
 
436
 
 
437
    Wrapper<Ice::ConnectionPtr>* obj = Wrapper<Ice::ConnectionPtr>::extract(zv TSRMLS_CC);
 
438
    assert(obj);
 
439
    assert(!obj->ptr);
 
440
    obj->ptr = new Ice::ConnectionPtr(p);
 
441
 
 
442
    return true;
 
443
}
 
444
 
 
445
bool
 
446
IcePHP::fetchConnection(zval* zv, Ice::ConnectionPtr& connection TSRMLS_DC)
 
447
{
 
448
    if(ZVAL_IS_NULL(zv))
 
449
    {
 
450
        connection = 0;
 
451
    }
 
452
    else
 
453
    {
 
454
        if(Z_TYPE_P(zv) != IS_OBJECT || Z_OBJCE_P(zv) != connectionClassEntry)
 
455
        {
 
456
            invalidArgument("value is not a connection" TSRMLS_CC);
 
457
            return false;
 
458
        }
 
459
        Wrapper<Ice::ConnectionPtr>* obj = Wrapper<Ice::ConnectionPtr>::extract(zv TSRMLS_CC);
 
460
        if(!obj)
 
461
        {
 
462
            return false;
 
463
        }
 
464
        connection = *obj->ptr;
 
465
    }
 
466
    return true;
 
467
}
 
468
 
 
469
bool
 
470
IcePHP::createConnectionInfo(zval* zv, const Ice::ConnectionInfoPtr& p TSRMLS_DC)
 
471
{
 
472
    int status;
 
473
    if(Ice::TCPConnectionInfoPtr::dynamicCast(p))
 
474
    {
 
475
        status = object_init_ex(zv, tcpConnectionInfoClassEntry);
 
476
    }
 
477
    else if(Ice::UDPConnectionInfoPtr::dynamicCast(p))
 
478
    {
 
479
        Ice::UDPConnectionInfoPtr info = Ice::UDPConnectionInfoPtr::dynamicCast(p);
 
480
        if((status = object_init_ex(zv, udpConnectionInfoClassEntry)) == SUCCESS)
 
481
        {
 
482
            add_property_string(zv, STRCAST("mcastAddress"), const_cast<char*>(info->mcastAddress.c_str()), 1);
 
483
            add_property_long(zv, STRCAST("mcastPort"), static_cast<long>(info->mcastPort));
 
484
        }
 
485
    }
 
486
    else if(Ice::IPConnectionInfoPtr::dynamicCast(p))
 
487
    {
 
488
        status = object_init_ex(zv, ipConnectionInfoClassEntry);
 
489
    }
 
490
    else
 
491
    {
 
492
        status = object_init_ex(zv, connectionInfoClassEntry);
 
493
    }
 
494
 
 
495
    if(status != SUCCESS)
 
496
    {
 
497
        runtimeError("unable to initialize connection info" TSRMLS_CC);
 
498
        return false;
 
499
    }
 
500
 
 
501
    if(Ice::IPConnectionInfoPtr::dynamicCast(p))
 
502
    {
 
503
        Ice::IPConnectionInfoPtr info = Ice::IPConnectionInfoPtr::dynamicCast(p);
 
504
        add_property_string(zv, STRCAST("localAddress"), const_cast<char*>(info->localAddress.c_str()), 1);
 
505
        add_property_long(zv, STRCAST("localPort"), static_cast<long>(info->localPort));
 
506
        add_property_string(zv, STRCAST("remoteAddress"), const_cast<char*>(info->remoteAddress.c_str()), 1);
 
507
        add_property_long(zv, STRCAST("remotePort"), static_cast<long>(info->remotePort));
 
508
    }
 
509
 
 
510
    add_property_bool(zv, STRCAST("incoming"), p->incoming ? 1 : 0);
 
511
    add_property_string(zv, STRCAST("adapterName"), const_cast<char*>(p->adapterName.c_str()), 1);
 
512
 
 
513
    Wrapper<Ice::ConnectionInfoPtr>* obj = Wrapper<Ice::ConnectionInfoPtr>::extract(zv TSRMLS_CC);
 
514
    assert(obj);
 
515
    assert(!obj->ptr);
 
516
    obj->ptr = new Ice::ConnectionInfoPtr(p);
 
517
 
 
518
    return true;
 
519
}