]> SALOME platform Git repositories - modules/yacs.git/blob - src/Communication/SALOME_Comm_i.cxx
Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/yacs.git] / src / Communication / SALOME_Comm_i.cxx
1 #ifndef WNT
2 #include <rpc/xdr.h>
3 #endif
4 #include "SALOME_Comm_i.hxx"
5 #include "poa.h"
6 #include "omnithread.h"
7 #include "Utils_SINGLETON.hxx"
8 #include "Utils_ORB_INIT.hxx"
9 #include "utilities.h"
10
11 #include "SenderFactory.hxx"
12 using namespace std;
13
14 #ifndef WNT
15 CORBA::ORB_var &getGlobalORB(){
16   ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
17   CORBA::ORB_var &orb = init(0,0);
18   return orb;
19 }
20 #endif
21
22 /*! Return the C++ data associated to the array to transmit.
23   Used when sender and receiver are collocalized.
24  */
25 const void *SALOME_Sender_i::getData(long &size) const{
26   size=_lgrTabToSend;
27   return _tabToSend;
28 }
29
30 /*! Return the sizeof() of each component of the generic array
31  */
32 int SALOME_Sender_i::getSizeOf() const {
33   return _sizeOf;
34 }
35
36 /*! Unique constructor */
37 SALOME_Sender_i::SALOME_Sender_i(const void *tabToSend,long lgrTabToSend,int sizeOf,bool ownTabToSend):_tabToSend(tabToSend),_lgrTabToSend(lgrTabToSend),_sizeOf(sizeOf),_ownTabToSend(ownTabToSend){
38 }
39
40 /*! To force ownerShip status */
41 void SALOME_Sender_i::setOwnerShip(bool own)
42 {
43   _ownTabToSend=own;
44 }
45
46 /*! Method for the remote destroy of the current servant. This method is used by the receiver to destroy the sender when the transfert is complete.
47  */
48 void SALOME_Sender_i::release()
49 {
50   PortableServer::ObjectId_var oid = _default_POA()->servant_to_id(this);
51   _default_POA()->deactivate_object(oid);
52   _remove_ref();
53 }
54
55 SALOME_SenderDouble_i::SALOME_SenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend)
56 {
57 }
58
59 /*! Destructor.
60  */
61 SALOME_SenderDouble_i::~SALOME_SenderDouble_i()
62 {
63   if(_ownTabToSend)
64     delete [] (double *)_tabToSend;
65 }
66
67 /*! Return a new sender of the same array but with an another protocol and delegates to the returned sender the ownership of array.
68  */
69 SALOME::SenderDouble_ptr SALOME_SenderDouble_i::buildOtherWithProtocol(SALOME::TypeOfCommunication type)
70 {
71   return SenderFactory::buildSender(type,this);
72 }
73
74 /*! Method to establish if the CORBA object refered by pCorba is collocalised.\n
75   If it is, the pointer to the servant that incarnates the CORBA object is returned.
76 */
77 SALOME_SenderDouble_i *SALOME_SenderDouble_i::find(SALOME::SenderDouble_ptr pCorba){
78   PortableServer::ServantBase *ret;
79   try {
80     ret=PortableServer::POA::_the_root_poa()->reference_to_servant(pCorba);
81   }
82   catch(...){
83     return 0;
84   }
85   ret->_remove_ref();
86   return dynamic_cast<SALOME_SenderDouble_i *>(ret);
87 }
88
89 SALOME_SenderInt_i::SALOME_SenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend)
90 {
91 }
92
93 /*! Destructor.
94  */
95 SALOME_SenderInt_i::~SALOME_SenderInt_i()
96 {
97   if(_ownTabToSend)
98     delete [] (int *)_tabToSend;
99 }
100
101 /*! Return a new sender of the same array but with an another protocol.
102  */
103 SALOME::SenderInt_ptr SALOME_SenderInt_i::buildOtherWithProtocol(SALOME::TypeOfCommunication type)
104 {
105   return SenderFactory::buildSender(type,this);
106 }
107
108 /*! Method to establish if the CORBA object refered by pCorba is collocalised.\n
109   If it is, the pointer to the servant that incarnates the CORBA object is returned.
110 */
111 SALOME_SenderInt_i *SALOME_SenderInt_i::find(SALOME::SenderInt_ptr pCorba){
112   PortableServer::ServantBase *ret;
113   try {
114     ret=PortableServer::POA::_the_root_poa()->reference_to_servant(pCorba);
115   }
116   catch(...){
117     return 0;
118   }
119   ret->_remove_ref();
120   return dynamic_cast<SALOME_SenderInt_i *>(ret);
121 }
122
123 SALOME_CorbaDoubleNCSender_i::SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend){
124 }
125
126 SALOME_CorbaDoubleNCSender_i::~SALOME_CorbaDoubleNCSender_i(){
127 }
128
129 CORBA::ULong SALOME_CorbaDoubleNCSender_i::getSize(){
130   CORBA::ULong ret=_lgrTabToSend;
131   return ret;
132 }
133
134 SALOME::vectorOfDouble* SALOME_CorbaDoubleNCSender_i::sendPart(CORBA::ULong offset, CORBA::ULong length){
135   SALOME::vectorOfDouble_var c1 = new SALOME::vectorOfDouble(length,length,(CORBA::Double *)((double *)_tabToSend+(long)offset),0);
136   return c1._retn();
137 }
138
139 SALOME::vectorOfDouble* SALOME_CorbaDoubleNCSender_i::send(){
140   SALOME::vectorOfDouble_var c1 = new SALOME::vectorOfDouble(_lgrTabToSend,_lgrTabToSend,(CORBA::Double *)_tabToSend,0);
141   return c1._retn();
142 }
143
144 SALOME_CorbaDoubleCSender_i::SALOME_CorbaDoubleCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend){
145 }
146
147 SALOME_CorbaDoubleCSender_i::~SALOME_CorbaDoubleCSender_i(){
148 }
149
150 CORBA::ULong SALOME_CorbaDoubleCSender_i::getSize(){
151   CORBA::ULong ret=_lgrTabToSend;
152   return ret;
153 }
154
155 SALOME::vectorOfDouble* SALOME_CorbaDoubleCSender_i::sendPart(CORBA::ULong offset, CORBA::ULong length){
156   SALOME::vectorOfDouble_var c1 = new SALOME::vectorOfDouble;
157   c1->length(length);
158   for (long i=0; i<length; i++)
159     c1[i] = ((double *)_tabToSend)[i+offset];
160   return c1._retn();
161 }
162
163 ////////////////////////
164
165 SALOME_CorbaLongNCSender_i::SALOME_CorbaLongNCSender_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_SenderInt_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend){
166 }
167
168 SALOME_CorbaLongNCSender_i::~SALOME_CorbaLongNCSender_i(){
169 }
170
171 CORBA::ULong SALOME_CorbaLongNCSender_i::getSize(){
172   CORBA::ULong ret=_lgrTabToSend;
173   return ret;
174 }
175
176 SALOME::vectorOfLong* SALOME_CorbaLongNCSender_i::sendPart(CORBA::ULong offset, CORBA::ULong length){
177   SALOME::vectorOfLong_var c1 = new SALOME::vectorOfLong(length,length,(CORBA::Long *)((long *)_tabToSend+(long)offset),0);
178   return c1._retn();
179 }
180
181 SALOME::vectorOfLong* SALOME_CorbaLongNCSender_i::send(){
182   SALOME::vectorOfLong_var c1 = new SALOME::vectorOfLong(_lgrTabToSend,_lgrTabToSend,(CORBA::Long *)_tabToSend,0);
183   return c1._retn();
184 }
185
186 SALOME_CorbaLongCSender_i::SALOME_CorbaLongCSender_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_SenderInt_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend){
187 }
188
189 SALOME_CorbaLongCSender_i::~SALOME_CorbaLongCSender_i(){
190 }
191
192 CORBA::ULong SALOME_CorbaLongCSender_i::getSize(){
193   CORBA::ULong ret=_lgrTabToSend;
194   return ret;
195 }
196
197 SALOME::vectorOfLong* SALOME_CorbaLongCSender_i::sendPart(CORBA::ULong offset, CORBA::ULong length){
198   SALOME::vectorOfLong_var c1 = new SALOME::vectorOfLong;
199   c1->length(length);
200   for (long i=0; i<length; i++)
201     c1[i] = ((long *)_tabToSend)[i+offset];
202   return c1._retn();
203 }
204
205 #ifdef HAVE_MPI2
206
207 unsigned long SALOME_MPISender_i::_tag1=0;
208
209 unsigned long SALOME_MPISender_i::_tag2=1;
210
211 SALOME_MPISender_i::SALOME_MPISender_i(const void *tabToSend,long lgrTabToSend,int sizeOf,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeOf,ownTabToSend){
212   _portName=new char[MPI_MAX_PORT_NAME];
213 }
214
215 SALOME_MPISender_i::~SALOME_MPISender_i(){
216   delete [] _portName;
217 }
218
219 SALOME::MPISender::param* SALOME_MPISender_i::getParam()
220 {
221   char stag[12];
222   int myproc,i=0;
223
224   SALOME::MPISender::param_var p = new SALOME::MPISender::param;
225   MPI_Comm_rank(MPI_COMM_WORLD,&_cproc);
226   p->myproc = _cproc;
227   p->tag1 = _tag1;
228   _tag1Inst=_tag1;
229   p->tag2 =_tag2;
230   _tag2Inst=_tag2;
231   std::string service("toto_");
232   sprintf(stag,"%d_",_tag1);
233   service += stag;
234   sprintf(stag,"%d_",p->tag2);
235   service += stag;
236   p->service = CORBA::string_dup(service.c_str());
237   MPI_Open_port(MPI_INFO_NULL, _portName);
238   MPI_Errhandler_set(MPI_COMM_WORLD,MPI_ERRORS_RETURN);
239   while ( i != TIMEOUT  && MPI_Publish_name((char*)service.c_str(),MPI_INFO_NULL,_portName) != MPI_SUCCESS) {
240     i++;
241   } 
242   MPI_Errhandler_set(MPI_COMM_WORLD,MPI_ERRORS_ARE_FATAL);
243   if ( i == TIMEOUT  ) { 
244     MPI_Close_port(_portName);
245     MPI_Finalize();
246     exit(-1);
247     }
248   _tag1 += 2;
249   _tag2 += 2;
250   return p._retn();
251 }
252
253 void SALOME_MPISender_i::send()
254 {
255   _type=getTypeOfDataTransmitted();
256   _argsForThr=new (void *)[8];
257   _argsForThr[0]=_portName;
258   _argsForThr[1]=&_lgrTabToSend;
259   _argsForThr[2]=(void *)_tabToSend;
260   _argsForThr[3]=&_cproc;
261   _argsForThr[4]=&_tag1Inst;
262   _argsForThr[5]=&_tag2Inst;
263   _argsForThr[6]=&_com;
264   _argsForThr[7]=&_type;
265
266   _newThr=new omni_thread(SALOME_MPISender_i::myThread,_argsForThr);
267   _newThr->start();
268 }
269
270 void* SALOME_MPISender_i::myThread(void *args)
271 {
272   void **argsTab=(void **)args;
273   long *lgrTabToSend=(long *)argsTab[1];
274   int *cproc=(int *)argsTab[3];
275   int *tag1=(int *)argsTab[4];
276   int *tag2=(int *)argsTab[5];
277   MPI_Comm *com=(MPI_Comm *)argsTab[6];
278   SALOME::TypeOfDataTransmitted *type=(SALOME::TypeOfDataTransmitted *)argsTab[7];
279
280   MPI_Comm_accept((char *)argsTab[0],MPI_INFO_NULL,0,MPI_COMM_SELF,com);
281   MPI_Send(lgrTabToSend,1,MPI_LONG,*cproc,*tag1,*com);
282   switch(*type)
283     { 
284     case SALOME::DOUBLE_:
285       MPI_Send(argsTab[2],*lgrTabToSend,MPI_DOUBLE,*cproc,*tag2,*com);
286       break;
287     case SALOME::INT_:
288       MPI_Send(argsTab[2],*lgrTabToSend,MPI_INT,*cproc,*tag2,*com);
289     }
290   omni_thread::exit();
291   return args;
292 }
293
294 void SALOME_MPISender_i::close(const SALOME::MPISender::param& p)
295 {
296   std::string service(p.service);
297   const char *st=p.service;
298   void *r;
299   _newThr->join(&r);
300   MPI_Comm_free(&_com); 
301   MPI_Unpublish_name((char *)service.c_str(),MPI_INFO_NULL,_portName); 
302   MPI_Close_port(_portName);
303   delete [] _argsForThr;
304 }
305
306 SALOME_MPISenderDouble_i::SALOME_MPISenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend)
307   :SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_MPISender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend)
308   ,SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend)
309 {
310 }
311
312 SALOME_MPISenderInt_i::SALOME_MPISenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend)
313   :SALOME_SenderInt_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_MPISender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend)
314   ,SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend)
315 {
316 }
317
318 #endif
319
320 #ifdef HAVE_SOCKET
321
322 //CCRT porting
323 #define _POSIX_PII_SOCKET
324 #define _LIBC_POLLUTION_H_
325
326 #include <sys/types.h>
327 #include <sys/socket.h>
328 #include <netinet/in.h>
329 #include <arpa/inet.h>
330 #include <netdb.h>
331 #include <unistd.h>
332
333 SALOME_SocketSender_i::SALOME_SocketSender_i(const void *tabToSend,long lgrTabToSend,int sizeOf,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeOf,ownTabToSend){
334   _IPAddress = inetAddress();
335   _serverSockfd = -1;
336   _clientSockfd = -1;
337 }
338
339 SALOME_SocketSender_i::~SALOME_SocketSender_i(){
340 }
341
342 std::string SALOME_SocketSender_i::inetAddress()
343 {
344    char s[256];
345    char t[INET_ADDRSTRLEN+1];
346    struct hostent *host;
347    struct in_addr saddr;
348
349    gethostname(s, 255);
350
351    *t = '\0';
352
353    saddr.s_addr = inet_addr(s);
354    if (saddr.s_addr != -1)
355       inet_ntop(AF_INET, &saddr, t, INET_ADDRSTRLEN);
356    else {
357       host = gethostbyname(s);
358       if (host != NULL)
359          inet_ntop(AF_INET, (struct in_addr *) *host->h_addr_list, 
360                    t, INET_ADDRSTRLEN);
361    }
362    return std::string(t);
363 }
364
365 SALOME::SocketSender::param * SALOME_SocketSender_i::getParam()
366 {
367
368   SALOME::SocketSender::param_var p = new SALOME::SocketSender::param;
369
370   p->lstart = 0;
371   p->lend = _lgrTabToSend - 1;
372   p->myport = _port;
373   p->internet_address = CORBA::string_dup(_IPAddress.c_str());
374
375   return p._retn();
376 }
377
378 void SALOME_SocketSender_i::send()
379 {
380   _type=getTypeOfDataTransmitted();
381   _argsForThr=new void *[6];
382   _argsForThr[0]=&_serverSockfd;
383   _argsForThr[1]=&_clientSockfd;
384   _argsForThr[2]=&_lgrTabToSend;
385   _argsForThr[3]=(void *)_tabToSend;
386   _argsForThr[4]=&_errorFlag;
387   _argsForThr[5]=&_type;
388
389   _newThr=new omni_thread(SALOME_SocketSender_i::myThread,_argsForThr);
390   _newThr->start();
391 }
392
393 void* SALOME_SocketSender_i::myThread(void *args)
394 {
395   int n=0, m;
396   void **argsTab=(void **)args;
397   int *serverSockfd=(int *)argsTab[0];
398   int *clientSockfd=(int *)argsTab[1];
399   long *lgrTabToSend=(long *)argsTab[2];
400   void *tabToSend=argsTab[3];
401   bool *errorFlag=(bool*)argsTab[4];
402   SALOME::TypeOfDataTransmitted *type=(SALOME::TypeOfDataTransmitted *)argsTab[5];
403   
404   XDR xp; /* pointeur sur le decodeur XDR */
405   
406   switch(*type)
407     { 
408     case SALOME::DOUBLE_:
409       xdrmem_create(&xp,(char*)tabToSend,(*lgrTabToSend)*sizeof(double),XDR_ENCODE );
410       xdr_vector( &xp, (char*)tabToSend, *lgrTabToSend, sizeof(double), (xdrproc_t)xdr_double );
411
412       *errorFlag = false;
413       while( n < *lgrTabToSend*sizeof(double) ){
414         m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(double)-n);
415         if( m < 0 ){
416           if( *clientSockfd >= 0 ){
417             ::close(*clientSockfd);
418             *clientSockfd = -1;
419           }
420           if( *serverSockfd >= 0 ){
421             ::close(*serverSockfd);
422             *serverSockfd = -1;
423           }
424           *errorFlag = true;
425         }
426         n += m;
427       }
428       xdr_destroy( &xp );
429
430       xdrmem_create(&xp,(char*)tabToSend,(*lgrTabToSend)*sizeof(double),XDR_DECODE );
431       xdr_vector( &xp, (char*)tabToSend, *lgrTabToSend, sizeof(double), (xdrproc_t)xdr_double );
432       xdr_destroy( &xp );
433       break;
434     case SALOME::INT_:
435       xdrmem_create(&xp,(char*)tabToSend,(*lgrTabToSend)*sizeof(int),XDR_ENCODE );
436       xdr_vector( &xp, (char*)tabToSend, *lgrTabToSend, sizeof(int), (xdrproc_t)xdr_int );
437
438       *errorFlag = false;
439       while( n < *lgrTabToSend*sizeof(int) ){
440         m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(int)-n);
441         if( m < 0 ){
442           if( *clientSockfd >= 0 ){
443             ::close(*clientSockfd);
444             *clientSockfd = -1;
445           }
446           if( *serverSockfd >= 0 ){
447             ::close(*serverSockfd);
448             *serverSockfd = -1;
449           }
450           *errorFlag = true;
451         }
452         n += m;
453       }
454       xdr_destroy( &xp );
455
456       xdrmem_create(&xp,(char*)tabToSend,(*lgrTabToSend)*sizeof(int),XDR_DECODE );
457       xdr_vector( &xp, (char*)tabToSend, *lgrTabToSend, sizeof(int), (xdrproc_t)xdr_int );
458       xdr_destroy( &xp );
459     }
460   return args;
461 }
462
463 void SALOME_SocketSender_i::initCom() throw(SALOME::SALOME_Exception)
464 {
465   struct sockaddr_in serv_addr;
466   socklen_t n;
467   SALOME::ExceptionStruct es;
468
469   /* Ouverture de la socket */
470   _serverSockfd = socket(AF_INET , SOCK_STREAM , 0);
471   if(_serverSockfd < 0) {
472     es.type = SALOME::COMM;
473     es.text = "error Socket exception";
474     throw SALOME::SALOME_Exception(es);
475   }
476   /* Socket structure initialisation*/
477   bzero((char*)&serv_addr,sizeof(serv_addr));
478   serv_addr.sin_family = AF_INET;
479   serv_addr.sin_port = 0; /* asking for a free port */
480   serv_addr.sin_addr.s_addr = INADDR_ANY;
481
482   /* Association of socket with a port */
483   if( ::bind(_serverSockfd, (struct sockaddr *) & serv_addr, 
484            sizeof(struct sockaddr)) < 0 ) {
485     closeCom();
486     es.type = SALOME::COMM;
487     es.text = "error bind Socket exception";
488     throw SALOME::SALOME_Exception(es);
489   }
490   /* Listening to the allocated port */
491   if( listen(_serverSockfd, 10) < 0 ) {
492     closeCom();
493     es.type = SALOME::COMM;
494     es.text = "error listen Socket exception";
495     throw SALOME::SALOME_Exception(es);
496   }
497   /* Retrieving port number*/
498   if( getsockname(_serverSockfd, (struct sockaddr *) & serv_addr, &n) < 0 ){
499     closeCom();
500     es.type = SALOME::COMM;
501     es.text = "error getName Socket exception";
502     throw SALOME::SALOME_Exception(es);
503   }
504   _port = htons(serv_addr.sin_port);
505   SCRUTE(_port);
506 }
507
508 void SALOME_SocketSender_i::acceptCom() throw(SALOME::SALOME_Exception)
509 {
510   socklen_t sin_size;
511   struct sockaddr_in client_addr;
512   SALOME::ExceptionStruct es;
513
514   sin_size = sizeof(struct sockaddr_in);
515   
516   _clientSockfd = accept(_serverSockfd, (struct sockaddr *)&client_addr, &sin_size);
517   if( _clientSockfd < 0 ){
518     closeCom();
519     es.type = SALOME::COMM;
520     es.text = "error accept Socket exception";
521     throw SALOME::SALOME_Exception(es);
522   }
523 }
524
525 void SALOME_SocketSender_i::closeCom()
526 {
527   if( _clientSockfd >= 0 ){
528     ::close(_clientSockfd);
529     _clientSockfd = -1;
530   }
531   if( _serverSockfd >= 0 ){
532     ::close(_serverSockfd);
533     _serverSockfd = -1;
534   }
535
536 }
537
538 void SALOME_SocketSender_i::endOfCom()
539 {
540   void *r;
541   _newThr->join(&r);
542   if(_errorFlag)
543     {
544       SALOME::ExceptionStruct es;
545       es.type = SALOME::COMM;
546       es.text = "error write Socket exception";
547       throw SALOME::SALOME_Exception(es);
548     }
549   delete [] _argsForThr;
550 }
551
552 SALOME_SocketSenderDouble_i::SALOME_SocketSenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend)
553   :SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_SocketSender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend)
554   ,SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend)
555 {
556 }
557
558 SALOME_SocketSenderInt_i::SALOME_SocketSenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend)
559   :SALOME_SenderInt_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_SocketSender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend)
560   ,SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend)
561 {
562 }
563
564 //CCRT porting
565 #undef _LIBC_POLLUTION_H_
566 #undef _POSIX_PII_SOCKET
567
568 #endif