Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of gnet Client #4

Closed
ducc opened this issue Sep 18, 2019 · 30 comments
Closed

Implementation of gnet Client #4

ducc opened this issue Sep 18, 2019 · 30 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed long term It's going to be a long-term work pending development Requested PR owner to improve code and waiting for the result proposal Proposal for this repo
Milestone

Comments

@ducc
Copy link

ducc commented Sep 18, 2019

Are there any plans to implement a client library?

@panjf2000
Copy link
Owner

panjf2000 commented Sep 19, 2019

I am focusing on the gnet implementation in server-side currently, so the delivery of client-side might be later.

@panjf2000 panjf2000 added help wanted Extra attention is needed proposal Proposal for this repo and removed help wanted Extra attention is needed labels Sep 19, 2019
@panjf2000 panjf2000 self-assigned this Sep 19, 2019
@icc99
Copy link

icc99 commented Dec 5, 2019

How does it go?

@panjf2000
Copy link
Owner

panjf2000 commented Dec 5, 2019

I plan to start it after a stable server version of gnet is released but gnet server is still under active development, so the implementation of the gnet client won't be delivered in the near future.

@panjf2000 panjf2000 reopened this Dec 5, 2019
@panjf2000 panjf2000 added enhancement New feature or request long term It's going to be a long-term work labels Dec 5, 2019
@panjf2000 panjf2000 changed the title Non blocking client library? Implementation of gnet Client Dec 5, 2019
@panjf2000 panjf2000 pinned this issue Dec 5, 2019
@panjf2000 panjf2000 added this to the v2 milestone Dec 21, 2019
@cocotyty
Copy link

cocotyty commented Apr 7, 2020

有进展吗?

@panjf2000
Copy link
Owner

暂时还没开始。

@panjf2000 panjf2000 unpinned this issue May 13, 2020
@amwfhv
Copy link

amwfhv commented Aug 21, 2020

希望快点开展client的支持,实际应用中会需要多个服务器协同工作,这时候就需要有Server和Client,我在改造的时候也遇到了相同的问题

@jingc1413
Copy link

+1

1 similar comment
@da-tai
Copy link

da-tai commented Sep 11, 2020

+1

@Ice3man543
Copy link

@panjf2000 i am also really interested in the client implementation and it's accompanying performance improvements compared to standard net package. If you could provide some references/guidelines regarding client implementation, i can try and make a PR!

@panjf2000
Copy link
Owner

panjf2000 commented Sep 17, 2020

@ALL
Sorry, I've been so stuck with work stuff lately that I don't have time for this in the near future!
So it would be great if someone is willing to devote to the development of gnet client!

@panjf2000 i am also really interested in the client implementation and it's accompanying performance improvements compared to standard net package. If you could provide some references/guidelines regarding client implementation, i can try and make a PR!

Maybe you can refer to the implementation of netty client? After all, I drew on many ideas from netty when I was developing the server framework of gnet. Thank you in advance. @Ice3man543

@panjf2000 panjf2000 added the help wanted Extra attention is needed label Sep 17, 2020
@ivanjaros
Copy link

+1 for client for sure

This was referenced Oct 30, 2020
@calbot
Copy link

calbot commented Nov 30, 2020

I wrote a basic TCP client implementation. Seems to be working so far. The basic idea was that a client works pretty much like a server except it doesn't have a listen address. So I pretty much just added a second set of methods for setting up the Client event loop under the Server object (now the name doesn't make sense). Then there is an additional registration step of TCP connections (rather than connections being registered from the listener socket on the server). So you can use the standard golang TCPConn to dial and get the file descriptor from it and then register it to start monitoring for events. This is more of a starting point if anyone is interested.

calbot@0a400d1

EDIT...
Updated so that it uses syscalls instead of net.TCPconn like gnet already does. That fixes disconnect issues.
calbot@b6c453e

@calbot
Copy link

calbot commented Feb 15, 2021

@lesismal I believe the standard golang TCP library uses events internally except it is serialized to a single goroutine from the API perspective. If you want to load test a server it's very nice to event/non-blocking IO client otherwise you'll quickly run out of memory for all the goroutines. If you want to test thousands or millions of client connections you're going to want to use non-blocking IO/events.

@calbot
Copy link

calbot commented Feb 16, 2021

Thanks @lesismal. I already ran my test using the my fork I mentioned above but I starred your repo for next time 😃

@jmjyw
Copy link

jmjyw commented Apr 30, 2021

有规划了吗?

@panjf2000
Copy link
Owner

panjf2000 commented Jul 20, 2021

The development of the client for gnet has already started, coming soon.

The first stable version will be released within the next two months.

@panjf2000 panjf2000 added the pending development Requested PR owner to improve code and waiting for the result label Jul 20, 2021
@Nyx2022
Copy link

Nyx2022 commented Aug 21, 2021

The development of the client for gnet has already started, coming soon.

The first stable version will be released within the next two months.

期待client的发布,希望功能全面、性能强劲
距离7.20已经1个月了,能透露一下计划是在什么时候发布吗,client支持Windows吗

@XuJia0210
Copy link

I was wandering ,if Client will be released in September?

@panjf2000
Copy link
Owner

I was wandering ,if Client will be released in September?

Yes.

@panjf2000 panjf2000 pinned this issue Sep 10, 2021
@liujiangang01
Copy link

请问,现在研发进展符合当初预期吗,9月底能否出个可交互版?

@panjf2000
Copy link
Owner

目前计划还是这个月底发布 v0.1.0 版本

@panjf2000 panjf2000 modified the milestones: v2, v1.6.0 Oct 7, 2021
@XuJia0210
Copy link

Will you release the gnet client in this month?

@zyc801208
Copy link

Focus on this issue progress...

@panjf2000
Copy link
Owner

panjf2000 commented Oct 27, 2021

Sorry for the delay, actually the code of the client has been done, but it's still not fully tested, I've been stuck in my daytime job lately.

@liupeidong0620
Copy link

咨询下client release版本有发布预计日期吗?

@panjf2000
Copy link
Owner

panjf2000 commented Nov 12, 2021

I've been stuck with the daytime job and other personal affairs for a really long time.

Therefore, I can't make a guarantee for the release date of gnet client, I expect to have time to work on it by the end of the month and release the first version in December.

@helios741
Copy link

如果client还是用net.Dial的话,这就又让runtime去接管epoll了,runtime.netpoll的优先级又比较低,在P繁忙的情况下会有十几ms的延迟。

@panjf2000
Copy link
Owner

gnet leverages net.Dial() to get a reliable client socket and then duplicate its underlying fd by dup(), finally call net.Conn.Close() which will remove the original fd from the netpoll of Golang and close it, by then the original fd will have no impact on Go netpoll.

@liujiangang01
Copy link

gnet的优势是利用底层网络特性,避免net库的沉重包袱,client为啥要用net.dial还是同步阻塞的呢?用系统调用级非阻塞connect, epoll托管连接状态,基于状态机驱动,比同步阻塞connect效率会高不少吧

@Nyx2022
Copy link

Nyx2022 commented Dec 11, 2021

hello,Client什么时候支持Windows环境呢?

@panjf2000 panjf2000 unpinned this issue Dec 25, 2021
0-haha referenced this issue in 0-haha/gnet Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed long term It's going to be a long-term work pending development Requested PR owner to improve code and waiting for the result proposal Proposal for this repo
Projects
None yet
Development

No branches or pull requests