deps/PicklingTools170Release/M2k/udpif/udpservice.cc
void UDPService::openNetworkPort_ ()
{
  //
  // Disable interrupts on socket
  //
  socketNotice_.disable();

  closeNetworkPort_();
  
  try {
    socketNotice_.clearDescriptors();
    int_4 try_port = port_;
    if (UDPSocketLib::UDP_openPort(&myServer_, try_port) == 0) {
      if (try_port != port_) {
        port_ = try_port;
        //Port.value(port_);
      }
      private_->socket_fd = UDPSocketLib::descriptorForServer(server_());

      //
      // Enable socket interrupts
      //
      socketNotice_.addDescriptor(UDPSocketLib::descriptorForServer(server_()));
      socketNotice_.enable();

      isOpen_ = true;

        log_.message("UDPService:: Opened UDP port: <" + Identifier() + ">;  "+
                     "Socket fd= <"+Stringize(UDPSocketLib::descriptorForServer(server_()))+">");
    }
  } catch (const SocketLowLevelEx& e) {
    log_.noteException(e);
    log_.warning("UDPService:: Unable to open UDP port: <" + Identifier() + ">");
    closeNetworkPort_();
  }
}
//
// Preconditions: 
//
// Postconditions:
//  Opened UDP network socket; load private socket file descriptor.
//
// Parameters:
//
// Description:
//
//  Opens UDP network socket interface on port number specified by Port.
//
//
Opened UDP network socket; load private socket file descriptor.





Opens UDP network socket interface on port number specified by Port.
Opened UDP network socket ; load private socket file descriptor . Opens UDP network socket interface on port number specified by Port .
void UDPService::openNetworkPort_ ()
{
   Disable interrupts on socket
  socketNotice_.disable();
  closeNetworkPort_();
  try {
    socketNotice_.clearDescriptors();
    int_4 try_port = port_;
    if (UDPSocketLib::UDP_openPort(&myServer_, try_port) == 0) {
      if (try_port != port_) {
        port_ = try_port;
        Port.value(port_);
      }
      private_->socket_fd = UDPSocketLib::descriptorForServer(server_());
       Enable socket interrupts
      socketNotice_.addDescriptor(UDPSocketLib::descriptorForServer(server_()));
      socketNotice_.enable();
      isOpen_ = true;
        log_.message("UDPService:: Opened UDP port: <" + Identifier() + ">;  "+
                     "Socket fd= <"+Stringize(UDPSocketLib::descriptorForServer(server_()))+">");
    }
  } catch (const SocketLowLevelEx& e) {
    log_.noteException(e);
    log_.warning("UDPService:: Unable to open UDP port: <" + Identifier() + ">");
    closeNetworkPort_();
  }
}
void UDPService :: openNetworkPort_ ( ) { socketNotice_ . disable ( ) ; closeNetworkPort_ ( ) ; try { socketNotice_ . clearDescriptors ( ) ; int_4 try_port = port_ ; if ( UDPSocketLib :: UDP_openPort ( & myServer_ , try_port ) == 0 ) { if ( try_port != port_ ) { port_ = try_port ; } private_ -> socket_fd = UDPSocketLib :: descriptorForServer ( server_ ( ) ) ; socketNotice_ . addDescriptor ( UDPSocketLib :: descriptorForServer ( server_ ( ) ) ) ; socketNotice_ . enable ( ) ; isOpen_ = true ; log_ . message ( " " + Identifier ( ) + " " + " " + Stringize ( UDPSocketLib :: descriptorForServer ( server_ ( ) ) ) + " " ) ; } } catch ( const SocketLowLevelEx & e ) { log_ . noteException ( e ) ; log_ . warning ( " " + Identifier ( ) + " " ) ; closeNetworkPort_ ( ) ; } }
Preconditions:
Postconditions:
Opened UDP network socket; load private socket file descriptor.
Preconditions : Postconditions : Opened UDP network socket ; load private socket file descriptor .
// // Disable interrupts on socket // //Port.value(port_); // // Enable socket interrupts //