bool
SocketDescriptor::Connect(SocketAddress address)
{
  assert(address.IsDefined());

  return ::connect(Get(), address.GetAddress(), address.GetSize()) >= 0;
}
示例#2
0
bool
SocketDescriptor::Connect(const SocketAddress &address)
{
  assert(address.IsDefined());

  return ::connect(Get(), address, address.GetLength()) >= 0;
}
示例#3
0
文件: Client.cpp 项目: MindMil/XCSoar
bool
SkyLinesTracking::Client::Open(const SocketAddress &_address)
{
  assert(_address.IsDefined());

  Close();

  address = _address;
  if (!socket.CreateUDP())
    return false;

#ifdef HAVE_SKYLINES_TRACKING_HANDLER
  if (io_thread != nullptr && handler != nullptr)
    io_thread->LockAdd(socket.Get(), IOThread::READ, *this);
#endif

  return true;
}