Changeset 9 in libcf++


Ignore:
Timestamp:
06/06/15 20:40:20 (9 years ago)
Author:
cheese
Message:

#1 fix binding interface

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/cf/network.h

    r7 r9  
    111111
    112112            /**
     113             * bind
     114             * @param port port
     115             * @throw cf::exception
     116             */
     117            cf::void_t bind(const cf::uint16_t port) const
     118                throw (cf::exception);
     119
     120            /**
    113121             * server ready
    114              * @param port port
    115122             * @param backlog [option] backlog
    116123             * @throw cf::exception
    117124             */
    118             cf::void_t listen(const cf::uint16_t port,
    119                               const cf::int32_t backlog = 5) const
     125            cf::void_t listen(const cf::int32_t backlog = 5) const
    120126                throw (cf::exception);
    121127
  • trunk/src/network.cpp

    r8 r9  
    281281}
    282282
    283 cf::void_t cf::network::tcp::listen(const cf::uint16_t port,
    284                                     const cf::int32_t backlog) const
     283cf::void_t cf::network::tcp::bind(const cf::uint16_t port) const
    285284    throw (cf::exception)
    286285{
     
    309308    if (result < 0)
    310309        THROW_EXCEPTION("cannot bind to " << port);
    311 
    312     result = ::listen(mSocket, backlog);
     310}
     311
     312cf::void_t cf::network::tcp::listen(const cf::int32_t backlog) const
     313    throw (cf::exception)
     314{
     315    cf::int32_t result = ::listen(mSocket, backlog);
    313316    if (result < 0)
    314317        THROW_EXCEPTION("cannot listen");
Note: See TracChangeset for help on using the changeset viewer.