~ubuntu-branches/debian/lenny/libtorrent/lenny

« back to all changes in this revision

Viewing changes to src/net/listen.cc

  • Committer: Bazaar Package Importer
  • Author(s): James Vega
  • Date: 2008-04-15 21:38:37 UTC
  • mfrom: (4.1.6 hardy)
  • Revision ID: james.westby@ubuntu.com-20080415213837-znilhi7a44yec99u
Tags: 0.11.9-1.1
* Non-maintainer upload.
* Fix FTBFS with gcc-4.3.  (Closes: #420920)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// libTorrent - BitTorrent library
2
 
// Copyright (C) 2005-2006, Jari Sundell
 
2
// Copyright (C) 2005-2007, Jari Sundell
3
3
//
4
4
// This program is free software; you can redistribute it and/or modify
5
5
// it under the terms of the GNU General Public License as published by
62
62
      bindAddress->family() != rak::socket_address::af_inet6)
63
63
    throw input_error("Listening socket must be bound to an inet or inet6 address.");
64
64
 
65
 
  if (!get_fd().open_stream() || !get_fd().set_nonblock())
66
 
    throw local_error("Could not allocate socket for listening.");
67
 
 
68
 
  if (!get_fd().set_reuse_address(true))
69
 
    throw local_error("Could not set listening port to reuse address.");
 
65
  if (!get_fd().open_stream() ||
 
66
      !get_fd().set_nonblock() ||
 
67
      !get_fd().set_reuse_address(true))
 
68
    throw resource_error("Could not allocate socket for listening.");
70
69
 
71
70
  rak::socket_address sa;
72
71
  sa.copy(*bindAddress, bindAddress->length());
126
125
 
127
126
void
128
127
Listen::event_error() {
129
 
  throw local_error("Listener port received an error event.");
 
128
  throw internal_error("Listener port received an error event.");
130
129
}
131
130
 
132
131
}