예제 #1
0
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;
}