如何把一个用户ID 和 一个PID 关联起来。。。

13 views
Skip to first unread message

foxlw66

unread,
Aug 28, 2009, 5:27:47 AM8/28/09
to MochiWeb
是这样的,我想实现一个IM系统。。。

其中我用到了 url?uid=111 这样的形式来传递打开这个页面的是哪个用户

在程序中我是这样接收的。。

Data = Req:parse_qs(),
Uid = list_to_binary(proplists:get_value("uid", Data))
set(Uid,self()); //这是一个朋友提供给我的方法,经测试,编译报错


其实我就是想把这个进程id和一个变量关联起来。。这样等我给他发消息的时候,我就可以利用这个uid

找到这个pid,以便给他能接受到消息,不知erlang中要如何关联呢??

Kunthar

unread,
Aug 28, 2009, 12:40:01 PM8/28/09
to moch...@googlegroups.com
"This is the case, I would like to achieve an IM system. . .

"Which I use the url? Uid = 111 in such a way to pass to open the page
in which user

"In the program is what I received. .

> Data = Req: parse_qs (),

> Uid = list_to_binary (proplists: get_value ( "uid", Data))

> Set (Uid, self ()); / / This is a friend provided to my method, tested, compiled Baocuo

"In fact, I just want this process id, and a variable associated with
them. . This time I send an announcement to give him the time, I can
take advantage of this uid

"Find the pid, in order to give him to receive messages, I do not know
how associated with it in erlang?

使用谷歌翻译成汉语译成英语,并发送到邮件列表。
http://translate.google.com/


Peace
\|/ Kunthar


2009/8/28 foxlw66 <fox...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages