~ubuntu-branches/ubuntu/precise/libtorrent/precise

« back to all changes in this revision

Viewing changes to src/net/listen.cc

  • Committer: Bazaar Package Importer
  • Author(s): Jose Luis Rivas
  • Date: 2007-09-11 15:12:31 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20070911151231-brompt7pecvfbaau
Tags: 0.11.8-1
* New upstream version
* debian/patches/update-changelog.patch:
 + Updated with the new changelog.
* debian/control:
 + Added the Homepage field, deleted Homepages from the descriptions.

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())
 
65
  if (!get_fd().open_stream() ||
 
66
      !get_fd().set_nonblock() ||
 
67
      !get_fd().set_reuse_address(true))
66
68
    throw resource_error("Could not allocate socket for listening.");
67
69
 
68
 
  if (!get_fd().set_reuse_address(true))
69
 
    throw resource_error("Could not set listening port to reuse address.");
70
 
 
71
70
  rak::socket_address sa;
72
71
  sa.copy(*bindAddress, bindAddress->length());
73
72
 
126
125
 
127
126
void
128
127
Listen::event_error() {
129
 
  throw resource_error("Listener port received an error event.");
 
128
  throw internal_error("Listener port received an error event.");
130
129
}
131
130
 
132
131
}