Skip to content

DomainSocket support #285

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

Closed
wants to merge 8 commits into from
Closed

DomainSocket support #285

wants to merge 8 commits into from

Conversation

czp3009
Copy link
Contributor

@czp3009 czp3009 commented Feb 13, 2022

This PR aims to implement support for DomainSockets, using code from #176.

But the test code still has some problems. Since the project's dependencies do not include "netty-transport-native-epoll", the Epoll class does not exist even when test on Linux system. Thus, NettyUtils always chose NioSocketChannel.

But adding "netty-transport-native-epoll" to the dependency will cause some tests for NettyUtils to fail because they are hard-coded and the test code will always determine if NioSocketChannel is returned.

I'm confused about how to test all the code, both without the domain socket and with it. Further, in order to test domain sockets, then all test code may not work on some systems, such as Windows.

andy-yx-chen and others added 7 commits January 2, 2020 15:32
@oshai
Copy link
Contributor

oshai commented Feb 13, 2022

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

import com.github.jasync.sql.db.mysql.message.server.PreparedStatementPrepareResponse
import com.github.jasync.sql.db.mysql.message.server.ResultSetRowMessage
import com.github.jasync.sql.db.mysql.message.server.ServerMessage
import com.github.jasync.sql.db.mysql.message.client.*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please refrain from using star imports

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My IDEA with default JetBrains code style automatic format to *, could you please provide your code style xml so i can import to my IDEA.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@czp3009
Copy link
Contributor Author

czp3009 commented Feb 14, 2022

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

hi @oshai , I'm sorry, but i couldn't find the description of system properties in the netty document, cloud you please provide the documentation page about that so I can learn it. Thanks!

@oshai
Copy link
Contributor

oshai commented Feb 14, 2022

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

hi @oshai , I'm sorry, but i couldn't find the description of system properties in the netty document, cloud you please provide the documentation page about that so I can learn it. Thanks!

I was referring java system properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

@czp3009
Copy link
Contributor Author

czp3009 commented Feb 14, 2022

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

hi @oshai , I'm sorry, but i couldn't find the description of system properties in the netty document, cloud you please provide the documentation page about that so I can learn it. Thanks!

I was referring java system properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

There may be some misunderstanding, I am not asking how to read and set system properties. I want to know what "forceNioSocket" or "forceDomainSocket" does, and what documentation they are described in.

Obviously, they are not java standard system properties.

@oshai
Copy link
Contributor

oshai commented Feb 14, 2022

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

hi @oshai , I'm sorry, but i couldn't find the description of system properties in the netty document, cloud you please provide the documentation page about that so I can learn it. Thanks!

I was referring java system properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

There may be some misunderstanding, I am not asking how to read and set system properties. I want to know what "forceNioSocket" or "forceDomainSocket" does, and what documentation they are described in.

Obviously, they are not java standard system properties.

What I meant is that in NettyUtils we will have code to check for system properties and in that case, use only the "forced" class without checking other types for existence.

@czp3009
Copy link
Contributor Author

czp3009 commented Feb 14, 2022

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

hi @oshai , I'm sorry, but i couldn't find the description of system properties in the netty document, cloud you please provide the documentation page about that so I can learn it. Thanks!

I was referring java system properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

There may be some misunderstanding, I am not asking how to read and set system properties. I want to know what "forceNioSocket" or "forceDomainSocket" does, and what documentation they are described in.
Obviously, they are not java standard system properties.

What I meant is that in NettyUtils we will have code to check for system properties and in that case, use only the "forced" class without checking other types for existence.

Got it!

@oshai
Copy link
Contributor

oshai commented Oct 5, 2022

@czp3009 any update on this PR?

@czp3009
Copy link
Contributor Author

czp3009 commented Oct 6, 2022

@czp3009 any update on this PR?

I'm sorry, I'm still trying to update this PR, but I've been very busy at work and haven't been able to find the time. If I have time I will add the previously missing test code to this PR immediately

@oshai
Copy link
Contributor

oshai commented Oct 7, 2022

Add support for unix domain socket #175

Thanks! note that I continue work on that in #319.

@czp3009
Copy link
Contributor Author

czp3009 commented Oct 12, 2022

Thank you very much for your awesome work, since unix domain socket has been implemented, I will close the PR

@czp3009 czp3009 closed this Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants