Incorrect parameters problem

View: New views
4 Messages — Rating Filter:   Alert me  

Incorrect parameters problem

by Mathew Benson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My project was compiling and executing, but I get an error now.  I'm not sitting at my desk right now, but I think it said "Incorrect parameters" when I examine the error.  Here's the offending code:
 
    boost::asio::io_service io_service;
   
    using boost::asio::ip::udp;
   
    udp::socket s(io_service, udp::endpoint(udp::v4(), 0));     
       
    udp::resolver resolver(io_service);
    udp::resolver::query query(udp::v4(), "127.0.0.1", 606);
   
    try
    {     
        udp::resolver::iterator iterator = resolver.resolve(query);
        s.send_to(boost::asio::buffer(buffer, size), *iterator);
    }
    catch ( std::exception& e )
    {
        std::cout << e.what() << std::endl;
   
    }
 
 
The first line in the try block is what causes the exception.  I thought I backed out all my changes, but I still can't get it to work.  Can somebody tell me what obvious dumb mistake I made?
 

_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Re: Incorrect parameters problem

by Michael Caisse-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mathew Benson wrote:

> My project was compiling and executing, but I get an error now.  I'm
> not sitting at my desk right now, but I think it said "Incorrect
> parameters" when I examine the error.  Here's the offending code:
>  
>     boost::asio::io_service io_service;
>    
>     using boost::asio::ip::udp;
>    
>     udp::socket s(io_service, udp::endpoint(udp::v4(), 0));    
>        
>     udp::resolver resolver(io_service);
>     udp::resolver::query query(udp::v4(), "127.0.0.1", 606);
>    

udp::resolver::query query(udp::v4(), "127.0.0.1", "606");


Regards -
michael

--

----------------------------------
Michael Caisse
Object Modeling Designs
www.objectmodelingdesigns.com


_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Re: Incorrect parameters problem

by Mathew Benson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks.  Now I feel dumb.

Sent from my iPhone

On Oct 29, 2009, at 6:10 PM, Michael Caisse <boost@...
 > wrote:

> Mathew Benson wrote:
>> My project was compiling and executing, but I get an error now.  
>> I'm not sitting at my desk right now, but I think it said  
>> "Incorrect parameters" when I examine the error.  Here's the  
>> offending code:
>>     boost::asio::io_service io_service;
>>       using boost::asio::ip::udp;
>>       udp::socket s(io_service, udp::endpoint(udp::v4(),  
>> 0));                udp::resolver resolver(io_service);
>>    udp::resolver::query query(udp::v4(), "127.0.0.1", 606);
>>
>
> udp::resolver::query query(udp::v4(), "127.0.0.1", "606");
>
>
> Regards -
> michael
>
> --
>
> ----------------------------------
> Michael Caisse
> Object Modeling Designs
> www.objectmodelingdesigns.com
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users@...
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Re: Incorrect parameters problem

by Michael Caisse-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mathew Benson wrote:
> Thanks.  Now I feel dumb.

Don't ... this question comes up on IRC about once a week.

The problem is that the most likely mistake is actually a valid
overload. But instead of assigning the port you are setting
some flags. It would be nice if the flags were not an int.

michael


>
> Sent from my iPhone
>
> On Oct 29, 2009, at 6:10 PM, Michael Caisse
> <boost@...> wrote:
>
>> Mathew Benson wrote:
>>> My project was compiling and executing, but I get an error now.  I'm
>>> not sitting at my desk right now, but I think it said "Incorrect
>>> parameters" when I examine the error.  Here's the offending code:
>>>     boost::asio::io_service io_service;
>>>       using boost::asio::ip::udp;
>>>       udp::socket s(io_service, udp::endpoint(udp::v4(),
>>> 0));                udp::resolver resolver(io_service);
>>>    udp::resolver::query query(udp::v4(), "127.0.0.1", 606);
>>>
>>
>> udp::resolver::query query(udp::v4(), "127.0.0.1", "606");
>>
>>
>> Regards -
>> michael
>>
>> --
>>
>> ----------------------------------
>> Michael Caisse
>> Object Modeling Designs
>> www.objectmodelingdesigns.com
>>
>>


_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users