Coder Social home page Coder Social logo

exmlrpc's People

Contributors

agfeo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

exmlrpc's Issues

Problem in tcp_serv:init when using with ejabberd

Hi

I get the following error when using exmlrpc with ejabberd.

=CRASH REPORT==== 11-Oct-2011::16:00:13 ===
crasher:
initial call: tcp_serv:init/2
pid: <0.384.0>
registered_name: []
exception error: no function clause matching
gen_tcp:mod({ip,{0,0,0,0}},undefined)
in function gen_tcp:listen/2
in call from tcp_serv:init/2
ancestors: [ejabberd_listeners,ejabberd_sup,<0.36.0>]
messages: []
links: [<0.263.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 377
stack_size: 24
reductions: 94
neighbours:

I use ejabberd2.1.6 and erlang R14B03.
ejabberd.cfg contains

{4560, ejabberd_xmlrpc, [{maxsessions, 10}, {timeout, 5000}]}

Could you please tell me if this is a known problem or if there is something wrong? TIA.

Regards
Balakrishnan.

XMLRPC call doesn't work for last.fm

last.fm uses the XMLRPC server at ws.audioscrobbler.com. Using the example Python code for accessing this server works fine, but using the equivalent for Erlang didn't work. Studying the output with Wireshark, I noticed that Erlang wasn't outputting a Host header, and started digging into the XMLRPC code. Hacking a Host header manually into the POST fixed the basic bug, but other issues cropped up (the request comes back as "HTTP/1.0 200 OK" not HTTP/1.1), and they all appeared to come back to being a result of manually building/parsing the HTTP request as opposed to using the inets http client, which would seems the sensible option to me!

Problem with rewriting the xmlrpc module like that is that call/3 and call/5 wouldn't work as inets won't let you specify the socket to use AFAIK, and I can't seem to figure out how to set KeepAlive with that, but it still seems like a sensible option.

Example code used for testing:

-module(lastfm).
-export([start/0]).

start() -> 
    io:format("~p~n", [artist()]).

artist() ->
    case xmlrpc:call("ws.audioscrobbler.com", 80, "/2.0/", {call, artist.search, [{struct,[{artist,"blah"}]}]}, false,
             10000) of
    {error, Reason} ->
        {error, Reason};
    {ok, Result} ->
        Result
    end.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.