anchor.diff:  	    case xmlrpc_decode:payload(Payload) of
   		{ok, DecodedPayload} when KeepAlive == false ->
   		    ?DEBUG_LOG({decoded_response, DecodedPayload}),
  -		    gen_tcp:close(Socket),
  +		    close(Socket),
   		    {ok, DecodedPayload};
   		{ok, DecodedPayload} when KeepAlive == true,
   					  Header#header.connection == close ->
   		    ?DEBUG_LOG({decoded_response, DecodedPayload}),
  -		    gen_tcp:close(Socket),
  +		    close(Socket),
   		    {ok, Socket, DecodedPayload};
   		{ok, DecodedPayload} ->
   		    ?DEBUG_LOG({decoded_response, DecodedPayload}),
   		    {ok, Socket, DecodedPayload};
   		{error, Reason} when KeepAlive == false ->
  -		    gen_tcp:close(Socket),
  +		    close(Socket),
   		    {error, Reason};
   		{error, Reason} when KeepAlive == true,
   				     Header#header.connection == close ->
  -		    gen_tcp:close(Socket),
  +		    close(Socket),
   		    {error, Socket, Reason};
   		{error, Reason} ->
   		    {error, Socket, Reason}
   	    end;
   	{error, Reason} when KeepAlive == false ->
  -	    gen_tcp:close(Socket),
  +	    close(Socket),
   	    {error, Reason};
   	{error, Reason} when KeepAlive == true,
   			     Header#header.connection == close ->
  -	    gen_tcp:close(Socket),
  +	    close(Socket),
   	    {error, Socket, Reason};
   	{error, Reason} -> {error, Socket, Reason}
       end.
   
   get_payload(Socket, Timeout, ContentLength) ->
  -    inet:setopts(Socket, [{packet, raw}]),
  -    gen_tcp:recv(Socket, ContentLength, Timeout).
  +    setopts(Socket, [{packet, raw}]),
  +    recv(Socket, ContentLength, Timeout).
   
   %% Exported: start_link/{1,5,6}
   
  -start_link(Handler) -> start_link(4567, 1000, 60000, Handler, undefined).
  +start_link(Handler) ->
  +    start_link(4567, 1000, 60000, Handler, undefined).
   
   start_link(Port, MaxSessions, Timeout, Handler, State) ->
       start_link(all, Port, MaxSessions, Timeout, Handler, State).
   
   start_link(IP, Port, MaxSessions, Timeout, Handler, State) ->
       OptionList = [{active, false}, {reuseaddr, true}|ip(IP)],
  -    SessionHandler = {xmlrpc_http, handler, [Timeout, Handler, State]}, 
  -    xmlrpc_tcp_serv:start_link([Port, MaxSessions, OptionList, SessionHandler]).
  +    SessionHandler = {xmlrpc_http, handler, [Timeout, Handler, State]},
  +    tcp_serv:start_link([Port, MaxSessions, OptionList, SessionHandler]).
   
   ip(all) -> [];
   ip(IP) when is_tuple(IP) -> {ip, IP}.
  
positive.code: %% Exported: stop/1
  
  stop(Pid) -> tcp_serv:stop(Pid).
  
negative.code: 			{ok, Header} ->
  			    handle_payload(Socket, KeepAlive, Timeout, Header);
  			{error, Reason} when KeepAlive == false ->
  			    close(Socket),
  			    {error, Reason};
  			{error, Reason} -> {error, Socket, Reason}
  		    end;
  		{error, Reason} when KeepAlive == false ->
  		    close(Socket),
  		    {error, Reason};
  		{error, Reason} ->
  		    {error, Socket, Reason}
  	    end;
  	{error, Reason} when KeepAlive == false ->
  	    close(Socket),
  	    {error, Reason};
  	{error, Reason} -> {error, Socket, Reason}
      end.
  
  send(Socket, URI, false, Payload) ->
      send(Socket, URI, "Connection: close\r\n", Payload);
  send(Socket, URI, true, Payload) -> send(Socket, URI, "", Payload);
  send(Socket, {Host,URI}, Header, Payload) ->
      Request =
  	["POST ", URI, " HTTP/1.1\r\n",
  	 "Content-Length: ", integer_to_list(lists:flatlength(Payload)),
  	 "\r\n",
  	 "User-Agent: Erlang XML-RPC Client 1.13\r\n",
  	 "Content-Type: text/xml\r\n",
  	 "Host: ", Host, "\r\n",
  	 Header, "\r\n",
  	 Payload],
      send(Socket, Request);
  send(Socket, URI, Header, Payload) ->
      Request =
  	["POST ", URI, " HTTP/1.1\r\n",
  	 "Content-Length: ", integer_to_list(lists:flatlength(Payload)),
  	 "\r\n",
  	 "User-Agent: Erlang XML-RPC Client 1.13\r\n",
  	 "Content-Type: text/XML\r\n",
  	 Header, "\r\n",
  	 Payload],
      send(Socket, Request).
  
  parse_response(Socket, Timeout) ->
      setopts(Socket, [{packet, line}]),
      case recv(Socket, 0, Timeout) of
  	{ok, "HTTP/1.1 200 OK\r\n"} -> parse_header(Socket, Timeout);
  	{ok, StatusLine} -> {error, StatusLine};
  	{error, Reason} -> {error, Reason}
  