Giter Club home page Giter Club logo

icomet's People

Contributors

0xmalloc avatar charlescui avatar ideawu avatar michael2008s avatar yanyiwu avatar yuexiajiayan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icomet's Issues

iComet stable-0.2.2.1 released

  • 0.2.2.1 (2014-04-09)
    • New features:
      • Refactor source code
    • Bug fixes:
      • Fix memory leak bug, MUST call evhttp_send_reply_end in connection_closecb(2014-04-12)
  • 0.2.2 (2014-03-24)
    • New features:
      • Use new/delete instead of custom memory pool
      • Deprecate Channel.id property
    • Incompatible changes:
      • Wrap json object property names in quotes(2014-04-07)
    • Bug fixes:
      • Fix bug on HttpQuery(evhttp_parse_query without evhttp_clear_headers)(2014-04-02)

@DuoZhang developed an Android chat app that can be used with the web chat demo.

推送服务器CPU过高

你好,我想请教一个问题,最近发现linux机器上的icomet-server 推送服务cpu过高,达到80%甚至90%,不知道是什么原因,通道也不多,每天大约800个左右,想问一下是什么原因?

IOS接受到消息的方法里怎么调用不了UIViewController里的其他方法

能给个简单的事例吗,照你的方法好像不行
// this function is called in a separated thread, it gets called when receive msg from icomet server
//回调接口
size_t icomet_callback(char _ptr, size_t size, size_t nmemb, void *userdata)
{
const size_t sizeInBytes = size_nmemb;
NSData data = [[NSData alloc] initWithBytes:ptr length:sizeInBytes];
NSString
s = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

//开启主线程
dispatch_async(dispatch_get_main_queue(), ^
               {

                   if([NSThread isMainThread])
                   {
                       NSLog(@"回到主线程");
                   }
                   [self setTextResult:s]; //这句话报self没有定义

               });



return sizeInBytes;

}

Todo:增加服务重启后发送消息的功能

icomet在重启后,seq就又从1开始了,客户这边如果用SEQ来判断消息的话会遗漏,怎么解决?
能不能让icomet在重启后发个消息什么 的,比如type ="restart"这样的标志

最大连接数为248

运行tools里的benchmark做测试 当sub大于248的时候
再用别的终端运行curl -v “url。。。”的时候返回recv failure:connection reset by peer

查看log也只是创建了248个连接(将cname固定的情况下就是一个channel有248个subs)

请问是否需要另外配置或者什么原因。

另外问一下:icomet是否能支持一个channel有上千甚至上万个subs。然后高频率的push消息(比如每秒推送一次或者两次)。场景大概就是实时发送股票指数到手机app终端
谢谢!

Resource interpreted as Script but transferred with MIME type text/html

Hi, guys!

Can you answer me, why in each message from server in Chrome console I get this message:

Resource interpreted as Script but transferred with MIME type text/html: "http://site.domain:8100/sub?cb=icomet_cb_0&cname=channel&seq=14&noop=5&token=&_=1431216336135&callback=cb"

And how I can fix it?

Thank you

ps. And can you told me, how I can hide information from http://site.domain:8100/sub?cb=icomet_cb_0&cname=channel&seq=1&noop=0&token=&_=1431217359932&callback=cb

Because if I open that link I see all messages in channel at current session

missing LICENSE file

Can you specify the license for this project? (I would prefer 3-clause BSD, same as ssdb)

icomet研究中发现的一些问题及解决方案

icomet 感觉使用非常的方便,针对需要有及时消息推送的项目足可以满足需求,我试用期间碰到一些问题总结分享一下:

"http://ip:port/stream?cname=c1&seq=1" 这个订阅API永远会返回当前频道中所有已存在的消息。

当时我的疑问是:

1:这些消息永远不会删除吗?(当消息非常多时,app第一次连接时要占用非常多的带宽)
2:有什么api可以删除过期的一些消息吗?(比如多少小时前的)
3:当空闲时这个api也会自动推送空消息,这个也有方法可以禁止吗?

后来资询了一下热情的作者,得到了回复:

1:默认保留最多10条,这个数字可以通过配置修改, 传seq=0就不会收到历史信息。
2:暂没有api删除过期的消息.
3:空闲时发空消息,这个是为了定期心跳,客户端可以用这个来判断server存活,可以修改配置延长。

另外几个概念要明确:
1:只有清空频道的说话,没有删除某条消息的概念。

以后再有使用经验继续补上,希望可以给没有能力读源代码的朋友参考。

icomet 有没有生产环境中的案例

最近在调研 icomet 和 nginx push stream 两个项目,

看到作者说 nginx push stream 的问题,但同时也看到国外的几个用 nginx push stream 的成功案例。

不知道 icomet 有没有经过验证的生产环境中的案例

Memory leak?

I guess the memory consumption of icomet-server should depend upon active connections which is almost same in my usage, but with time (few days) it swells a lot. Relaunching the server fixes the issue, pls. see the image below - for same number of connections (active) it was using 1.1GB of RAM and restarting shrinked it to 33 MB!!!

sshot-2

Token timeout

Hello!

Can you tell me, whether it is possible to increase the time of token timeout?

By default, it afaik - 30 minutes.

Thank you!

icomet如何群发消息(推送给所有人)

icomet如何群发消息(推送给所有人)
我现在发送消息是用php用curl来推送消息的
地址:http://127.0.0.1:8000/push?cname=".$cname."&content=".$content
请问icomet除了cname,content还有其他参数设置是可以推送给所有人的么,还是说要另外创建一条长连接,用户监听自己id的cname和all的cname,然后all就是推送给所有人??
请问有无更好的解决方案,不想挂两条长连接,怕占用太多进程。。。

Upload image like wechat possible?

Is there any future development roadmap for this?
e.g. image uploading/sending, cache expiration, download small images first before requesting big image download etc.

推送服务器的日志:127.0.0.1 自己一直sub是什么意思?

2015-07-03 11:17:09.632 [DEBUG] server.cpp(249): 127.0.0.1:42810 sub 44ab59c0ce2065692649b4a8907b2859, seq: 575, subs: 6
2015-07-03 11:17:09.637 [DEBUG] server.cpp(249): 127.0.0.1:42811 sub f46b7062c7005e9f, seq: 407, subs: 3
2015-07-03 11:17:09.638 [DEBUG] server.cpp(249): 127.0.0.1:42812 sub f46b7062c7005e9f, seq: 407, subs: 4
2015-07-03 11:17:09.642 [DEBUG] server.cpp(249): 127.0.0.1:42813 sub f46b7062c7005e9f, seq: 407, subs: 5
2015-07-03 11:17:09.646 [DEBUG] server.cpp(249): 127.0.0.1:42814 sub f46b7062c7005e9f, seq: 407, subs: 6

icomet中文的问题

已经用content= URLEncoder.encode(content,"utf-8");设置过中文,
icomet4j 的源码部分也对应改了
mConn.setRequestProperty("Charset", "utf-8");
reader = new BufferedReader(new InputStreamReader(this.input, "utf-8"));
但是为啥收到的中文还是乱码呢。。。另外用js获取到的也是乱码

如何实现同时订阅多个频道的消息

目的:客户端希望可以支持接收只针对自己的消息(独占一个频道,通过向频道发送消息),客户端希望可以接收某一频道的消息(与别人共同在一个频道,通过向频道发送消息),如何支持同时可以接收这两种消息(web端),如果同时2个长连接就没有意义了,求解决方案

Major bug fix: memory leak

This bug is in class HttpQuery, the evkeyvalq is not freed by evhttp_clear_headers() after evhttp_parse_query().

  • Affected version: all versions of icomet
  • Status: fixed

broadcast 无效

广播发送的消息 , 客户端接收不到
push的消息能接收到 , 最新master分支安装的

iComet Qt Api

Hi guys, I want to ask you about existing Api for iComet for C++ (Qt predominantly) or other languages on which I can write code for desktop.

Thank you!

Icoment info

Hello, does Icomet work with WebSocket, ?
What are the lybrary apis we can work with?
What are the javascript lybraries we can wrk with?
Do you have a scale benchmark simultaneous node connection and how many messages per second ?
What are the;
Scaling
Horizonal (multiple nodes) and Vertical scaling?

Regards, Heather

使用icomet进行服务器端推送,客户端监听,进程自己死掉,但是不知道如何排查

RT,求教,我看logs/log.txt
全部是debug信息,这种问题如何排查呢?会不会是内存不够导致死掉了呢?我的内存比较的低
【log信息:】
2014-07-10 12:11:40.340 [DEBUG] server.cpp(241): 218.58.77.117:4323 sub result, seq: 6, subs: 10
2014-07-10 12:11:40.450 [DEBUG] server.cpp(185): 218.17.150.249:50810 sub_end result, subs: 9,
2014-07-10 12:11:40.453 [DEBUG] server.cpp(241): 218.75.66.130:54719 sub result, seq: 6, subs: 10
2014-07-10 12:11:40.552 [DEBUG] server.cpp(241): 183.14.109.91:32358 sub result, seq: 6, subs: 11
2014-07-10 12:11:40.602 [DEBUG] server.cpp(241): 123.97.237.85:2178 sub schedule, seq: 6, subs: 23
2014-07-10 12:11:41.084 [DEBUG] server.cpp(241): 60.161.97.33:28789 sub result, seq: 6, subs: 12
2014-07-10 12:11:41.109 [DEBUG] server.cpp(241): 218.94.115.131:11256 sub result, seq: 6, subs: 13
2014-07-10 12:11:41.269 [DEBUG] server.cpp(241): 58.250.109.83:37121 sub result, seq: 6, subs: 14
2014-07-10 12:11:41.290 [DEBUG] server.cpp(241): 183.14.109.91:13882 sub result, seq: 6, subs: 15
2014-07-10 12:11:41.450 [DEBUG] server.cpp(185): 183.62.51.195:52533 sub_end schedule, subs: 22,
2014-07-10 12:11:41.450 [DEBUG] server.cpp(185): 115.238.84.134:53042 sub_end result, subs: 14,
2014-07-10 12:11:41.579 [DEBUG] server.cpp(241): 123.97.237.85:2177 sub result, seq: 6, subs: 15
2014-07-10 12:11:41.672 [DEBUG] server.cpp(241): 120.40.4.70:11566 sub result, seq: 6, subs: 16
2014-07-10 12:11:42.019 [DEBUG] server.cpp(241): 218.17.150.249:50810 sub result, seq: 6, subs: 17
2014-07-10 12:11:42.092 [DEBUG] server.cpp(241): 218.94.115.131:10960 sub result, seq: 6, subs: 18
2014-07-10 12:11:42.200 [DEBUG] server.cpp(241): 27.38.66.236:59911 sub result, seq: 6, subs: 19
2014-07-10 12:11:42.364 [DEBUG] server.cpp(241): 58.210.35.50:4563 sub result, seq: 6, subs: 20
2014-07-10 12:11:42.389 [DEBUG] server.cpp(241): 223.104.4.55:52907 sub result, seq: 6, subs: 21
2014-07-10 12:11:42.944 [DEBUG] server.cpp(241): 183.62.51.195:52533 sub schedule, seq: 0,
【free信息】
[root@hkdmall logs]# free -m
total used free shared buffers cached
Mem: 1024 1014 9 0 0 3
-/+ buffers/cache: 1010 13
Swap: 2048 1859 188

【top信息】
top - 12:13:05 up 14 days, 23:25, 2 users, load average: 1.12, 4.88, 4.98
Tasks: 24 total, 1 running, 23 sleeping, 0 stopped, 0 zombie
Cpu(s): 2.1%us, 4.3%sy, 0.0%ni, 89.4%id, 0.0%wa, 0.0%hi, 0.0%si, 4.3%st
Mem: 1048576k total, 1041424k used, 7152k free, 0k buffers
Swap: 2097152k total, 1902612k used, 194540k free, 4704k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
17914 root 20 0 12.3g 1.8g 1704 S 53.8 182.7 17:54.17 java
1236 www 20 0 64068 20m 124 S 0.0 2.0 0:51.50 nginx
1237 www 20 0 63476 19m 72 S 0.0 1.9 0:25.77 nginx
24932 root 20 0 84364 11m 196 S 7.7 1.1 3:54.95 memcached
29613 root 20 0 456m 10m 2396 S 0.0 1.0 4:01.80 mysqld
6301 root 20 0 12632 1212 956 R 0.0 0.1 0:00.01 top
4480 root 20 0 86512 1092 424 S 0.0 0.1 0:00.44 sshd
4630 root 20 0 24344 944 536 D 0.0 0.1 0:02.66 comet-server

Too many subscribers

Too many subscribers,您好icomet使用过您的这个产品,但是今天出现了太多的订阅者,这个不知道是否有地方可以配置。
16:18:43 icomet[0] resp Object {type: "429", cname: "result", seq: 0, content: "Too many subscribers"} icomet.js:296
16:18:46 icomet[1] sub icomet.js:294
Resource interpreted as Script but transferred with MIME type text/html: "http://192.80.133.190:8100/sub?cb=icomet_cb_1&cname=schedule&seq=0&noop=0&token=&_=1404893926813&callback=cb". jquery-1.8.2.js:8304
16:18:47 icomet[1] resp Object {type: "429", cname: "schedule", seq: 0, content: "Too many subscribers"} icomet.js:296
16:18:49 icomet[0] sub icomet.js:294
Resource interpreted as Script but transferred with MIME type text/html: "http://192.80.133.190:8100/sub?cb=icomet_cb_0&cname=result&seq=0&noop=0&token=&_=1404893929922&callback=cb&_=1404893929922". jquery-1.8.2.js:8304
16:18:50 icomet[0] resp Object {type: "429", cname: "result", seq: 0, content: "Too many subscribers"}

IOS接受到消息的方法里怎么调用不了UIViewController里的其他方法?

// this function is called in a separated thread, it gets called when receive msg from icomet server
//回调接口
size_t icomet_callback(char _ptr, size_t size, size_t nmemb, void *userdata)
{
const size_t sizeInBytes = size_nmemb;
NSData data = [[NSData alloc] initWithBytes:ptr length:sizeInBytes];
NSString
s = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

NSLog(@"返回结果:%@", s);

//这里为什么调用不了UIViewController里的其他方法

return sizeInBytes;

}

ubuntu 12.04 64位编译报错

reads.la -lz ../libevent_openssl.la -lssl -lcrypto -lrt
libtool: link: gcc -g -O2 -Wall -fno-strict-aliasing -pthread -pthread -o .libs/regress regress-regress.o regress-regress_buffer.o regress-regress_http.o regress-regress_dns.o regress-regress_testutils.o regress-regress_rpc.o regress-regress.gen.o regress-regress_et.o regress-regress_bufferevent.o regress-regress_listener.o regress-regress_util.o regress-tinytest.o regress-regress_main.o regress-regress_minheap.o regress-regress_thread.o regress-regress_zlib.o regress-regress_ssl.o ../.libs/libevent.so ../.libs/libevent_pthreads.so -lz ../.libs/libevent_openssl.so -lssl -lcrypto -lrt -pthread
make[3]: Leaving directory /data/soft/icomet/deps/libevent-2.0.21-stable/test' make[2]: Leaving directory/data/soft/icomet/deps/libevent-2.0.21-stable/test'
make[1]: Leaving directory /data/soft/icomet/deps/libevent-2.0.21-stable' build.sh: 76: build.sh: [[: not found build.sh: 100: build.sh: [[: not found cd src/util; make make[1]: Entering directory/data/soft/icomet/src/util'
g++ -c -g -O2 -Wall -Wno-sign-compare -I "/data/soft/icomet/deps/libevent-2.0.21-stable" -I "/data/soft/icomet/deps/libevent-2.0.21-stable/include" -I "/data/soft/icomet/deps/libevent-2.0.21-stable/compact" -I "/data/soft/icomet/deps/jemalloc-3.4.0/include" log.cpp
g++ -c -g -O2 -Wall -Wno-sign-compare -I "/data/soft/icomet/deps/libevent-2.0.21-stable" -I "/data/soft/icomet/deps/libevent-2.0.21-stable/include" -I "/data/soft/icomet/deps/libevent-2.0.21-stable/compact" -I "/data/soft/icomet/deps/jemalloc-3.4.0/include" config.cpp
In file included from config.cpp:3:0:
strings.h: In function 'std::string int64_to_str(int64_t)':
strings.h:133:43: warning: format '%lld' expects argument of type 'long long int', but argument 4 has type 'int64_t {aka long int}' [-Wformat]
strings.h:133:43: warning: format '%lld' expects argument of type 'long long int', but argument 4 has type 'int64_t {aka long int}' [-Wformat]
strings.h: In function 'std::string uint64_to_str(uint64_t)':
strings.h:145:43: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'uint64_t {aka long unsigned int}' [-Wformat]
strings.h:145:43: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'uint64_t {aka long unsigned int}' [-Wformat]
strings.h: In function 'int parse_ip_port(const char_, std::string_, int_)':
strings.h:167:30: error: invalid conversion from 'const char_' to 'char_' [-fpermissive]
make[1]: *_* [config.o] Error 1
make[1]: Leaving directory `/data/soft/icomet/src/util'
make: *** [all] Error 2

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.