Overview
Features
Download
Documentation
Community
Add-Ons & Services

Memory allocation errors using Poco::Net

Please post support and help requests here.

Memory allocation errors using Poco::Net

Postby wseguin » 18 Jun 2007, 20:19

Hi,

Trying to implement a simple client socket connection using the Poco::Net module. When I try to instanciate many of the classes, it trowls a "bad_alloc" in New.cpp. This happens if I try to create a IPAddress object or a SocketAddress object. Any ideas?

string server("10.4.1.16");
Poco::Net::IPAddress ipa(server);

and

SocketAddress addr(server, port);

Both throw the same std::bad_alloc error.

Thanks
wseguin
 
Posts: 4
Joined: 05 Jun 2007, 20:40

Re: Memory allocation errors using Poco::Net

Postby alex » 18 Jun 2007, 21:54

> Trying to implement a simple client socket connection using the Poco::Net module. When I try to instanciate many of the classes, it trowls a "bad_alloc" in New.cpp. This happens if I try to create a IPAddress object or a SocketAddress object. Any ideas?
>
Code: Select all

>     string server("10.4.1.16");
>     Poco::Net::IPAddress ipa(server);

>
> and
>
Code: Select all

>   SocketAddress addr(server, port);

>
> Both throw the same std::bad_alloc error.

This does not look like a Poco-related error. Please post more code and we may be able to help you. Alternatively, trace the execution of your code in debugger and see where does the exception originate (in which case you may not even need our help).

Also, when posting code, please enclose it in code tags like this:
Code: Select all
[code] YourCodeHere ych;
[/code] Checking out the Preview before posting is highly recommended, too.

Alex
alex
 
Posts: 1106
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Memory allocation errors using Poco::Net

Postby wseguin » 10 Jul 2007, 21:33

You're right, not a Poco problem. Turned out to be a scoping/desctructor issue. Thanks.
wseguin
 
Posts: 4
Joined: 05 Jun 2007, 20:40


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron