[sheepdog] [disscuss] Design of Libsheepdog
Kai Zhang
kyle at zelin.io
Mon Jul 1 03:58:00 CEST 2013
On Jul 1, 2013, at 7:29 AM, MORITA Kazutaka <morita.kazutaka at gmail.com> wrote:
> At Sun, 30 Jun 2013 17:29:28 +0800,
> Kai Zhang wrote:
>>
>> On Jun 27, 2013, at 11:34 AM, MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp> wrote:
>>
>>>>
>>>> /* connection */
>>>> int sd_init(char *addr, const sd_t *sd);
>>>
>>> I think the syntax of addr needs discussion:
>>> - How to specify a port number?
>>> - How to connect to a unix domain socket?
>>>
>>>
>>
>> I think we can use a unified form: "ip:port".
>>
>> If the ip is local, sd_init() will try to use unix domain socket.
>
> Do you mean "localhost:<unix domain socket path>"?
Well, what I meant is that user don't need to care about unix domain socket.
They always use string "x.x.x.x:nnnn" as the argument.
However, libsheepdog can detect whether x.x.x.x is a local ip.
It it is, I think we can predicate a unix domain socket path based on the ip and port number.
For example, we can have a rule that if a sheep is listening on 127.0.0.1:1234,
it's unix domain socket path should be something like /tmp/sheepdog/127_0_0_1-1234.sock
Thanks,
Kyle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20130701/8053a3f2/attachment-0004.html>
More information about the sheepdog
mailing list