Pat29 | 28 Nov 16:09 2004
Picon

newby questions

Hello,

Sorry for these questions but i had been learning Erlang (2 weeks) with the 
french book
and i got the following error after launched this command on WinXP SP2

D:\Pat29\erlang\Erlang Book\ch8\ex1\src>erl -sname database -pa ebin

{error_logger,{{2004,11,28},{14,47,58}},'Protocol: ~p: register/listen 
error: ~p
~n',[inet_tcp,enotsock]}
{error_logger,{{2004,11,28},{14,47,58}},crash_report,[[{pid,<0.18.0>},{registere
d_name,net_kernel},{error_info,{error,badarg}},{initial_call,{gen,init_it,[gen_s
erver,<0.15.0>,<0.15.0>,{local,net_kernel},net_kernel,{database,shortnames,15000
},[]]}},{ancestors,[net_sup,kernel_sup,<0.8.0>]},{messages,[]},{links,[<0.15.0>]
},{dictionary,[{longnames,false}]},{trap_exit,true},{status,running},{heap_size,
233},{stack_size,21},{reductions,293}],[]]}
{error_logger,{{2004,11,28},{14,47,58}},supervisor_report,[{supervisor,{local,ne
t_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{
pid,undefined},{name,net_kernel},{mfa,{net_kernel,start_link,[[database,shortnam
es]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2004,11,28},{14,47,58}},supervisor_report,[{supervisor,{local,ke
rnel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefine
d},{name,net_sup},{mfa,{erl_distribution,start_link,[]}},{restart_type,permanent
},{shutdown,infinity},{child_type,supervisor}]}]}
{error_logger,{{2004,11,28},{14,47,58}},crash_report,[[{pid,<0.7.0>},{registered
_name,[]},{error_info,{shutdown,{kernel,start,[normal,[]]}}},{initial_call,{appl
ication_master,init,[<0.5.0>,<0.6.0>,{appl_data,kernel,[application_controller,e
rl_reply,auth,boot_server,code_server,disk_log_server,disk_log_sup,erl_prim_load
er,error_logger,file_server,file_server_2,fixtable_server,global_group,global_na
(Continue reading)

Matthias Lang | 28 Nov 22:05 2004
Picon

Re: newby questions

Pat29 writes:

 > Sorry for these questions but i had been learning Erlang (2 weeks) 
 > with the french book and i got the following error after launched 
 > this command on WinXP SP2

 > D:\Pat29\erlang\Erlang Book\ch8\ex1\src>erl -sname database -pa ebin
 > 
 > {error_logger,{{2004,11,28},{14,47,58}},'Protocol: ~p: register/listen 
 > error: ~p ~n',[inet_tcp,enotsock]}

[...]

 > {{badmatch,{error,enotsock}},[{gstk_port_handler,init,2}]}

It's saying that it tried to open a TCP socket and the operating
system replied 'no way, José'. If this was happening on a unix
machine, I'd say "have you compiled a kernel without sockets or
without IP networking?", but since it's windows I'm clueless.

I'm guessing that if you start non-distributed Erlang (i.e. just run
'erl') and then do this:

   1> gen_tcp:listen(0, []).
   {ok,#Port<0.82>}

your setup will reply {error, enotsock} instead of {ok, Port}. Right?

Can you do anything else with TCP on that machine, for instance does
'telnet' work? 
(Continue reading)

Mickael Remond | 29 Nov 09:19 2004

Re: newby questions

Matthias Lang wrote:
> Pat29 writes:
> 
>  > Sorry for these questions but i had been learning Erlang (2 weeks) 
>  > with the french book and i got the following error after launched 
>  > this command on WinXP SP2
> 
>  > D:\Pat29\erlang\Erlang Book\ch8\ex1\src>erl -sname database -pa ebin
>  > 
>  > {error_logger,{{2004,11,28},{14,47,58}},'Protocol: ~p: register/listen 
>  > error: ~p ~n',[inet_tcp,enotsock]}
> 
> [...]
> 
>  > {{badmatch,{error,enotsock}},[{gstk_port_handler,init,2}]}
> 
> It's saying that it tried to open a TCP socket and the operating
> system replied 'no way, José'. If this was happening on a unix
> machine, I'd say "have you compiled a kernel without sockets or
> without IP networking?", but since it's windows I'm clueless.
> 
> I'm guessing that if you start non-distributed Erlang (i.e. just run
> 'erl') and then do this:
> 
>    1> gen_tcp:listen(0, []).
>    {ok,#Port<0.82>}
> 
> your setup will reply {error, enotsock} instead of {ok, Port}. Right?
> 
> Can you do anything else with TCP on that machine, for instance does
(Continue reading)

Vlad Dumitrescu | 29 Nov 10:23 2004
Picon

Re: newby questions

From: "Mickael Remond" <mickael.remond <at> erlang-fr.org>
> Does someone now if the socket API has changed in Windows XP ?

If it works on some machines and don't on others, then it can't be an API
change, can it? It has to be something with specific setup.

Is XP SP2 installed on the machines that don't work? SP2 introduces some
security features that break many applications (like enabling the firewall).
However IIRC the latest SP2 releases fix this (I didn't install until it was
stable and never had any problems).

regards
/Vlad

Mickael Remond | 29 Nov 14:35 2004

Re: newby questions

Vlad Dumitrescu wrote:
> From: "Mickael Remond" <mickael.remond <at> erlang-fr.org>
> 
>>Does someone now if the socket API has changed in Windows XP ?
> 
> 
> If it works on some machines and don't on others, then it can't be an API
> change, can it? It has to be something with specific setup.

It could that socket API has been enhanced to support the new security 
feature of Windows. The old API could only work in certain context.
I do not use Windows so that's just a guess.

> Is XP SP2 installed on the machines that don't work? SP2 introduces some
> security features that break many applications (like enabling the firewall).
> However IIRC the latest SP2 releases fix this (I didn't install until it was
> stable and never had any problems).

The problem appeared on a machine without Service Pack 2.

--

-- 
Mickaël Rémond
  http://www.erlang-projects.org/


Gmane