-#ifndef WNT
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SALOME_Comm_i.hxx"
+#ifndef WIN32
+#ifndef __APPLE__
#include <rpc/xdr.h>
#endif
-#include "SALOME_Comm_i.hxx"
-#include "poa.h"
+#endif
+#include "omniORB4/poa.h"
#include "omnithread.h"
#include "Utils_SINGLETON.hxx"
#include "Utils_ORB_INIT.hxx"
#include "utilities.h"
#include "SenderFactory.hxx"
-using namespace std;
-#ifndef WNT
+#ifndef WIN32
CORBA::ORB_var &getGlobalORB(){
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
CORBA::ORB_var &orb = init(0,0);
SALOME::MPISender::param* SALOME_MPISender_i::getParam()
{
char stag[12];
- int myproc,i=0;
+ int i=0;
SALOME::MPISender::param_var p = new SALOME::MPISender::param;
MPI_Comm_rank(MPI_COMM_WORLD,&_cproc);
void SALOME_MPISender_i::send()
{
_type=getTypeOfDataTransmitted();
- _argsForThr=new (void *)[8];
+ _argsForThr=new void *[8];
_argsForThr[0]=_portName;
_argsForThr[1]=&_lgrTabToSend;
_argsForThr[2]=(void *)_tabToSend;
void SALOME_MPISender_i::close(const SALOME::MPISender::param& p)
{
std::string service(p.service);
- const char *st=p.service;
void *r;
_newThr->join(&r);
MPI_Comm_free(&_com);
host = gethostbyname(s);
if (host != NULL)
inet_ntop(AF_INET, (struct in_addr *) *host->h_addr_list,
- t, INET_ADDRSTRLEN);
+ t, INET_ADDRSTRLEN);
}
return std::string(t);
}
*errorFlag = false;
while( n < *lgrTabToSend*sizeof(double) ){
- m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(double)-n);
- if( m < 0 ){
- if( *clientSockfd >= 0 ){
- ::close(*clientSockfd);
- *clientSockfd = -1;
- }
- if( *serverSockfd >= 0 ){
- ::close(*serverSockfd);
- *serverSockfd = -1;
- }
- *errorFlag = true;
- }
- n += m;
+ m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(double)-n);
+ if( m < 0 ){
+ if( *clientSockfd >= 0 ){
+ ::close(*clientSockfd);
+ *clientSockfd = -1;
+ }
+ if( *serverSockfd >= 0 ){
+ ::close(*serverSockfd);
+ *serverSockfd = -1;
+ }
+ *errorFlag = true;
+ }
+ n += m;
}
xdr_destroy( &xp );
*errorFlag = false;
while( n < *lgrTabToSend*sizeof(int) ){
- m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(int)-n);
- if( m < 0 ){
- if( *clientSockfd >= 0 ){
- ::close(*clientSockfd);
- *clientSockfd = -1;
- }
- if( *serverSockfd >= 0 ){
- ::close(*serverSockfd);
- *serverSockfd = -1;
- }
- *errorFlag = true;
- }
- n += m;
+ m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(int)-n);
+ if( m < 0 ){
+ if( *clientSockfd >= 0 ){
+ ::close(*clientSockfd);
+ *clientSockfd = -1;
+ }
+ if( *serverSockfd >= 0 ){
+ ::close(*serverSockfd);
+ *serverSockfd = -1;
+ }
+ *errorFlag = true;
+ }
+ n += m;
}
xdr_destroy( &xp );
/* Association of socket with a port */
if( ::bind(_serverSockfd, (struct sockaddr *) & serv_addr,
- sizeof(struct sockaddr)) < 0 ) {
+ sizeof(struct sockaddr)) < 0 ) {
closeCom();
es.type = SALOME::COMM;
es.text = "error bind Socket exception";