boost::asio (Permission denied, Connection refused)

Discussion in 'C++' started by wo3kie@gmail.com, Apr 19, 2008.

  1. Guest

    I had not any issues with Windows, but with Linux I failed

    It is going about an example from boost::asio library tutorial
    # Daytime.1 - A synchronous TCP daytime client
    # Daytime.2 - A synchronous TCP daytime server

    After compilation, I changed access settings for files
    # chmod a+x server.cpp
    # chmod a+x client.cpp

    and after I started a program
    # ./server

    I received an error message like this
    # Permission denied

    whilst ./client started in second terminal correctly

    Fortunately small changed in server.cpp was helpful

    # tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), 22222 /
    *13*/));

    from value 13 into 22222 (as an example) (but I do not understand,
    what an influance has port number for 'permision denied')

    Now both server and client starts correctly
    but client just after start receive another error message
    # Connection refused

    I have found in google issue like this, unfortunately without any
    solution
    http://www.unix.com/high-level-programming/35804-client-server-progra...

    Thanks in advance for help,
    Lukasz
     
    , Apr 19, 2008
    #1
    1. Advertising

  2. Martin York Guest

    On Apr 19, 3:04 pm, "" <> wrote:
    > I had not any issues with Windows, but with Linux I failed
    >
    > It is going about an example from boost::asio library tutorial
    > # Daytime.1 - A synchronous TCP daytime client
    > # Daytime.2 - A synchronous TCP daytime server
    >
    > After compilation, I changed access settings for files
    > # chmod a+x server.cpp
    > # chmod a+x client.cpp
    >
    > and after I started a program
    > # ./server
    >
    > I received an error message like this
    > # Permission denied
    >
    > whilst ./client started in second terminal correctly
    >
    > Fortunately small changed in server.cpp was helpful
    >
    > # tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), 22222 /
    > *13*/));
    >
    > from value 13 into 22222 (as an example) (but I do not understand,
    > what an influance has port number for 'permision denied')
    >
    > Now both server and client starts correctly
    > but client just after start receive another error message
    > # Connection refused
    >
    > I have found in google issue like this, unfortunately without any
    > solutionhttp://www.unix.com/high-level-programming/35804-client-server-progra...
    >
    > Thanks in advance for help,
    > Lukasz


    Off topic for C++
    Try a linux group or a group dealing with sockets.

    Also note that most OS reserve low port numbers for privileged
    accesses (ie root or some equivalent). I am sure you will get more
    exact info from a more appropriate group.
     
    Martin York, Apr 20, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?utf-8?B?5byg5rKI6bmP?=

    How to compile the HelloWorld of boost.asio?

    =?utf-8?B?5byg5rKI6bmP?=, Aug 10, 2006, in forum: C++
    Replies:
    1
    Views:
    3,578
    Victor Bazarov
    Aug 10, 2006
  2. Torsten Mueller

    boost::asio for HTTP -> data truncated

    Torsten Mueller, Aug 12, 2010, in forum: C++
    Replies:
    3
    Views:
    2,079
    Francesco S. Carta
    Aug 13, 2010
  3. Christopher
    Replies:
    0
    Views:
    1,460
    Christopher
    Jun 8, 2011
  4. Antonio Di Monaco
    Replies:
    0
    Views:
    1,277
    Antonio Di Monaco
    Apr 14, 2012
  5. Torsten Mueller
    Replies:
    1
    Views:
    519
    Bart van Ingen Schenau
    Jun 23, 2013
Loading...

Share This Page