S.l.e!ep.¢%

像打了激速一样,以四倍的速度运转,开心的工作
简单、开放、平等的公司文化;尊重个性、自由与个人价值;
posts - 1098, comments - 335, trackbacks - 0, articles - 1
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

源URL:http://lists.zeromq.org/pipermail/zeromq-dev/2010-February/002383.html

意思没太懂,大概就是Z.E.R.O.M.Q主要是针对服务器间的通信,获取客户端连接IP的意义不大

Hi Fred,

>>> Just one question remains : were can I grab in the server
>>> environment the IP address and portnumber of the sending client ?
>> No way to do that at the moment, other than doing it at the app level
>> (make up a client ID / use the IP address and stick it in the
>> message).

Let me give some background here.

Simply said: 0MQ should manage connections for you. Your application 
should be agnostic about exact location/identity of the peers. If you 
want to work on the level of individual connections, use BSD sockets 
rather than 0MQ.

More complex answer: The issue has to do with scaling 0MQ into internet 
scales. What you want to know is the identity of the peer who sent the 
message. You are not interested in any middleboxes that may be on the 
way (like zmq_forwarder etc.) Thus, getting IP address we've received 
the message from is useless - it's IP address of the previous hop. Also, 
if IP address is used as the identity, two applications running on the 
same box would look exactly the same. Same application bound to several 
network interfaces would look different depending on how exactly you are 
connected to it. Etc.

At the moment, the only thing you can do is to choose a name for your 
application and fill it into the message. In easy to modify 0MQ to do 
the thing for you, however, it's not a conceptual solution.

Real solution still requires a lot of research work. Feel free to start 
the discussion though.

> OK, but that's (at least for me) not thrustworthy. Like SMTP telling me 
> who they are. ;-)

What you would consider trustworthy, what kind of attacks should it be 
resistent to, etc.

> You don't mind if I take a look at the sources to see whether it is 
> doable for me ?

Sure. Go for it. Any experimentation is valuable! The source is licensed 
under LGPL so you can modify it in any way given that you publish the 
result under LGPL.

Martin

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理