inets: request error on Windows XP

John Webb jwebb@REDACTED
Fri Apr 29 17:25:51 CEST 2005


On a side note, I  thought to use erlang to develop an application to 
collect image data from network cameras and video sources. Many devices 
use Netscape's multibyte/x-mixed-replace content-type to stream MJPEG 
data so I started to started to experiment with an extension to the 
inets http client to handle this case. Has anyone done anything along 
these lines or would be interested in such a function? (Warning! Erlang 
novice at work!)

Regards,
-jw


On Apr 29, 2005, at 10:52 PM, Anders Nygren wrote:

> On 4/28/05, John Webb <jwebb@REDACTED> wrote:
>> Hello,
>>
>> I am using R10B-4 and have run into a problem using http:request/4 on
>> Windows XP (SP2). It seems that specifying a numeric IP address causes
>> a badmatch error somewhere in the depths of inets. The same code runs
>> fine on MAC OS. Has anyone else seen this problem or am I missing
>> something on the windows side?
>>
>> On MAC OS 10.3.9 built from the source distribution I get:
>>
>>    Erlang (BEAM) emulator version 5.4.5 [source]
>>
>>    Eshell V5.4.5  (abort with ^G)
>>    1> application:start(inets).
>>    ok
>>    2> {ok,
>> {R1,_,_}}=http:request(get,{"http://www.google.com",[]},[],[]),R1.
>>    {"HTTP/1.1",200,"OK"}
>>    3> {ok,
>> {R2,_,_}}=http:request(get,{"http://66.102.7.147",[]},[],[]),R2.
>>    {"HTTP/1.1",200,"OK"}
>>    4>
>>
>> But on Windows XP (SP2) from the binary distribution I get:
>>
>>    Erlang (BEAM) emulator version 5.4.5 [threads:0]
>>
>>    Eshell V5.4.5  (abort with ^G)
>>    1> application:start(inets).
>>    ok
>>    2> {ok,
>> {R1,_,_}}=http:request(get,{"http://www.google.com",[]},[],[]),R1.
>>    {"HTTP/1.1",200,"OK"}
>>    3> {ok,
>> {R2,_,_}}=http:request(get,{"http://66.102.7.147",[]},[],[]),R2.
>>    ** exited: {{case_clause,{undefined,{error,
>>                                          {'EXIT',
>>                                              
>> {{badmatch,{error,badarg}},
>>
>> [{httpc_manager,start_handler,2},
>>
>> {httpc_manager,handle_request,2},
>>
>> {httpc_manager,handle_call,3},
>>                                                
>> {gen_server,handle_msg,6},
>>                                                
>> {proc_lib,init_p,5}]}}}}},
>>              [{http,handle_request,5},
>>               {erl_eval,do_apply,5},
>>               {erl_eval,expr,5},
>>               {shell,exprs,6},
>>               {shell,eval_loop,3}]} **
>>    4>
>
> This looks like a problem I have had too.
> See,
> http://www.erlang.org/ml-archive/erlang-questions/200503/msg00014.html
> http://www.erlang.org/ml-archive/erlang-questions/200503/msg00045.html
>
> I never got any response to those, and I never found the problem.
> I am happy to see that it works with a name instead of IP address.
>
> Another problem with http:request, (at least on Linux), is that if You 
> give a
> timeout, the request works but there is a crash somewhere in inets, 
> when
> it tries to remove the timer.
> So for me it has been impossible to use http on both Linux and Windows,
> so I have had to make a Java node to handle http requests.
>
> This is not just a little embarrasing while trying to convince 
> management
> to let me use Erlang in some projects.
>
> /Anders
>




More information about the erlang-questions mailing list