socket programming
- From: "Advait" <advait_raut@xxxxxxxxxxxxxx>
- Date: 17 Sep 2006 12:20:15 -0700
Hi
I am newbi in socket programming. I am learning it
with SWI for the simplicity and quick results.
I tried some socket SWI's socket predicates,
during that I met a problem.
I opened two seperate prolog tasks.
Following small codes shows what I wrote in
each task stepwise.
*Note*: 'advait' is my hostname i.e. my compueter itself
%%%%%%%%%%%%% Task 1 %%%%%%%%%%%%%%%%%%%%%%%%%
?- tcp_socket(Sock),tcp_bind(Sock,P). %% Step 1
Sock = '$socket'(252)
P = 1032
?- tcp_socket(Sk),tcp_connect(Sk, raut:1033). %% step 3
ERROR: Socket error: Connection refused
Exception: (17) socket:tcp_connect('$socket'(256), advait:1033) ?
creep
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%% Task 2 %%%%%%%%%%%%%%%%%%%%%
?- tcp_socket(Sock),tcp_bind(Sock,P). %% Step 2
Sock = '$socket'(252)
P = 1033
?- tcp_socket(Sk),tcp_connect(Sk, advait:1032). %% Step 4 immediately
%% after step 3
ERROR: Socket error: Connection refused
Exception: (8) socket:tcp_connect('$socket'(256), advait:1032) ?
creep
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Why did I get these errors in each of the tasks?
Please, Can anyone help me ?
yours
Advait
.
- Follow-Ups:
- Re: socket programming
- From: Jan Wielemaker
- Re: socket programming
- Prev by Date: Re: Free Prolog libraries?
- Next by Date: Re: The n-knights problem
- Previous by thread: SWI-Prolog : Out Of Local Stack
- Next by thread: Re: socket programming
- Index(es):
Relevant Pages
|