UTL_TCP usage [message #39081] |
Thu, 13 June 2002 10:01 |
SAI PADMANABHAN
Messages: 3 Registered: June 2002
|
Junior Member |
|
|
I have written a code which sends an string to a server and receives string back from that server, using UTL_TCP.It is successfully writing to the server and the other server also responds back, but my rpogram is not getting out of the loop or never quits.Hence i dont know if its reading properly or not.
can someone point out what the problem could be.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
CREATE OR REPLACE
procedure comm(v_trans in varchar2,v_error in out varchar2,v_reply in out varchar2) is
c utl_tcp.connection;
v_out varchar2(2000);
v_write PLS_INTEGER:=0;
ret_val pls_integer;
BEGIN
c:= utl_tcp.open_connection('10.244.124.219',2000);
ret_val := utl_tcp.write_line(c, v_trans);
ret_val := utl_tcp.write_line(c);
BEGIN
LOOP
v_reply := utl_tcp.get_line(c, TRUE); -- read result
END LOOP;
EXCEPTION
WHEN utl_tcp.end_of_input THEN
NULL; -- end of input
END;
utl_tcp.close_connection(c);
exception
WHEN utl_tcp.end_of_input THEN
NULL; -- end of input
when others then
v_error := substr(SQLERRM,1,100);
END;
/
|
|
|
|
Re: UTL_TCP usage [message #39114 is a reply to message #39081] |
Mon, 17 June 2002 13:52 |
SAI PADMANABHAN
Messages: 3 Registered: June 2002
|
Junior Member |
|
|
It did not work.
The utl_tcp.get_line function is looking for a carriage return or a line feed character and is not able to find it.
The string that i get from the other server does not have a carriage return and hence the program hangs there.
Any Suggestions?
|
|
|
|