[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-07-08 Thread Allen George (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17564482#comment-17564482
 ] 

Allen George commented on THRIFT-5283:
--

[~tokcum]I'm so sorry, and I totally understand your disappointment. Would you 
be open to using a git hash as a dependency in your crate?

>From [the 
>book|https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html] 
>we have an example like this:

{{regex = { git = "https://github.com/rust-lang/regex;, branch = "next" }}}

You know that the commit is in master, and we're not about to remove it, so it 
should be safe for you to do this until the next release.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-07-07 Thread tokcum (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17564022#comment-17564022
 ] 

tokcum commented on THRIFT-5283:


[~allengeorge] I was excited that thrift 0.16.0 was published recently, so I 
could continue with my osquery-rust bindings. However, apparently support for 
Unix Domain Sockets didn't make it into 0.16.0 despite being accepted as PR and 
merged into master. Big disappointment on my side after months of waiting to 
get this published to crates.io. :(

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-30 Thread tokcum (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17514922#comment-17514922
 ] 

tokcum commented on THRIFT-5283:


[~prateeknischal] : I'm not able to resolve this issue. However, you as an 
creator might be able to set this to resolved. Thanks.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-30 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17514919#comment-17514919
 ] 

Tobias Mucke commented on THRIFT-5283:
--

[~allengeorge], thank you for merging. That feels good. Looking forward to the 
next release on crates.io. :)

 

I've just created the issue for the Windows named pipe support:

https://issues.apache.org/jira/browse/THRIFT-5542

Not sure, when I'll find time to work on this. I've just started to take first 
steps in this direction. I'm not so familiar with Windows development.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-30 Thread Allen George (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17514565#comment-17514565
 ] 

Allen George commented on THRIFT-5283:
--

[~tokcum] Yes - splitting Windows pipe support into a separate ticket makes 
sense. Separately, thank you for your work on the Unix pipe support - I've just 
merged it!

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-28 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17513323#comment-17513323
 ] 

Tobias Mucke commented on THRIFT-5283:
--

I looked into how Windows named pipes under rust. I checked out the std lib and 
found that it doesn't provide a nice abstraction layer to Windows named pipes. 
What I found is a cratae called miow which facilitates handling of named pipes 
in rust.

I think we should look into this direction to make thrift's rust library 
support Windows named pipes.

[~allengeorge] : I think we should create a new issue in Jira to track Windows 
named pipe support.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-22 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17510738#comment-17510738
 ] 

Tobias Mucke commented on THRIFT-5283:
--

Looking ahead, I checked how osquery connects to its extensions on Windows: it 
uses Named Pipe. I'll look into this as I'm planning to support also Windows 
with osquery-rust. I think the thrift crate doesn't support Named Pipes yet.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-19 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17509326#comment-17509326
 ] 

Tobias Mucke commented on THRIFT-5283:
--

Thanks for pointing this out. I was asking because my own crate osquery-rust  
depends on this and when I published it to crates.io, I realized that a 
published crate can only depend on other published crates. Anyway, I pushed it 
to crates.io in a dysfunctional way and immediately started to work on the 
thrift side.

Looking forward to the next release of the thrift crate. Let me know if I can 
do anything to help.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-19 Thread Jens Geyer (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17509235#comment-17509235
 ] 

Jens Geyer commented on THRIFT-5283:


{quote}what about the release cycle. Is this going to be part of the next 
release?
{quote}
As soon as it got merged to master, yes.
{quote}When is it planned?
{quote}
There is no strict plan but most likely similar to last year, i.e. beta branch 
in July, Release whenever we're done with it.
{quote}On crates.io thrift is still at 0.15.
{quote}
[~allengeorge] usually does that.
{quote}The Cargo.toml of thrift/lib/rs is already at 0.17. So, I figure, there 
is a release planned in the near future?
{quote}
Master is always at the next version when we do a branch. That does not imply 
any particular release date or time frame, not even that it will be released 
under that number at all. At this stage its just a number that is larger than 
any stable branch and likely to be the next version.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-18 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17509109#comment-17509109
 ] 

Tobias Mucke commented on THRIFT-5283:
--

Thank you [~allengeorge]. I updated the PR taking your feedback into account.

Provided that the PR is merged, what about the release cycle. Is this going to 
be part of the next release? When is it planned? On crates.io thrift is still 
at 0.15. The Cargo.toml of thrift/lib/rs is already at 0.17. So, I figure, 
there is a release planned in the near future?

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-17 Thread Allen George (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17508514#comment-17508514
 ] 

Allen George commented on THRIFT-5283:
--

Took a quick look, and in general - looks good! One minor comment about the 
test code but otherwise...

As for unit tests, I think you're right: an integration test (whether the 
kitchen sink/cross tests) should suffice.

Thank you for your work!

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-17 Thread Allen George (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17508509#comment-17508509
 ] 

Allen George commented on THRIFT-5283:
--

[~tokcum] Sorry for the delay. I'll take a look over the weekend. At least a 
first pass.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-17 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17508461#comment-17508461
 ] 

Tobias Mucke commented on THRIFT-5283:
--

So far no feedback on PR. As this PR is a blocker for my osquery-rust crate I 
appreciate any feedback. Thanks.

[~allengeorge] : could you spare some time to review the PR? Thank you for your 
support.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-10 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17504678#comment-17504678
 ] 

Tobias Mucke commented on THRIFT-5283:
--

Here we go: https://github.com/apache/thrift/pull/2545.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-10 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17504653#comment-17504653
 ] 

Tobias Mucke commented on THRIFT-5283:
--

[~allengeorge]
 * I updated the rust <-> rust test harnesses and run them manually both with 
Tcp and Unix Domain Sockets. Looks good. (/)
 * I also worked on cross-test harnesses and tested them. There are still 18 
rust related tests that fail. However, they also fail in master branch. So, at 
least my contribution does not introduce new fails. (/)
 * Regarding unit tests: not sure which tests would make sense, as there is no 
logic involved in support Unix Domain sockets. I think, the rust compiler takes 
care of how this additional function is used. (?)

Having said that, I'll bring the PR forward shortly.

 

P.S. The testing code looks cluttered to me. I didn't improve it much but 
followed the existing approach. A refactoring might improve readability of the 
tests. Please let me know, if you would like to see further improvement in this 
area in future.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-07 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17502461#comment-17502461
 ] 

Tobias Mucke commented on THRIFT-5283:
--

I checked out the approach for cross-test harnesses and I think I'll start with 
this by reviewing the approach of thrift/lib/cpp and thrift/lib/py.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-07 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17502256#comment-17502256
 ] 

Tobias Mucke commented on THRIFT-5283:
--

[~allengeorge] ok, I'll try to provide some unit tests and work on rust as well 
as cross-test harness. To be honest, I'm not sure what this actually involves. 
Yet another learning opportunity. :)

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-05 Thread Allen George (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17501862#comment-17501862
 ] 

Allen George commented on THRIFT-5283:
--

[~tokcum] Tobias - thank you so much for looking at this issue. Unfortunately 
my time is quite limited nowadays, so I'll try and review your PR as 
quickly/best I can. That said, I think that to include this feature you should:

# Add some unit tests if possible
# Update the rust <-> rust test harnesses so that you can ensure that the basic 
implementation works 
(https://github.com/apache/thrift/tree/master/lib/rs/test); NOTE: 
unfortunately, actually running the test harness is manual
# Update the cross-test harnesses so that you can ensure that other languages 
which support unix sockets can communicate with the rust server/client 
(https://github.com/apache/thrift/tree/master/test/rs 
https://github.com/apache/thrift/blob/b8920b01cb72af93a716bb203fcd8a1202936b97/test/tests.json#L681)

This would ensure that this change can be properly tested and maintained going 
forward.

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-05 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17501749#comment-17501749
 ] 

Tobias Mucke commented on THRIFT-5283:
--

Hi, I've looked into adding the capability to listen to Unix Domain Sockets 
(UDS) with the following principles in mind:
 # Avoid introducing a breaking change.
 # Keep the power of ToSocketAddrs trait.

I would like to share my findings so you can follow my thinking and also my 
conclusion. Please correct me if I'm wrong, thank you.

The fn we are talking about is in server::threaded.
{code:java}
pub fn listen( self, listen_address: A) -> 
crate::Result<()> {code}
When adding UDS support to this fn we can not stick to ToSocketAddrs trait as 
its only capable to create std::net::SocketAddr which does not cover UDS. So, 
we need a new trait able to cover all cases from ToSocketAddrs (fulfilling 
principle 1) + UDS. I tried to achieve this with a new enum TSocket and a trait 
ToTSocket. So the new fn signature looks like:
{code:java}
pub fn listen( self, listen_address: A) -> crate::Result<()> 
{code}
 

The enum TSocket and trait ToTSocket:
{code:java}
pub enum TSocket {
Ip(SocketAddr),
#[cfg(unix)]
Uds(UnixListener),
}

pub trait ToTSocket {
fn to_socket() -> TSocket;
}{code}
However with this simple approach I'm unable to fulfill principle 2 because 
ToSocketAddress defines different Iterator types depending on the Type the 
trait is implemented for. Thus, I did experiment with dyn + Box to bring the 
TSocket::Ip variant to eye level of ToSocketAddress trait.

This is one example I experimented with:
{code:java}
Ip(Box>) {code}
However, I didn't manage to implement this.

To conclude, I suggest to implement a new fn in server::threaded supporting 
UDS. This approach will also meet the two principles. I'm confident that this 
approach will work and keeps the code base clean. I've found this very same 
approach in actix_web::HttpServer which e.g. offers a fn listen and fn 
listen_uds.

For your reference: 
[https://docs.rs/actix-web/latest/actix_web/struct.HttpServer.html#method.listen]

Any other thoughts on this?

Kind regards,

Tobias

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2022-03-02 Thread Tobias Mucke (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17500209#comment-17500209
 ] 

Tobias Mucke commented on THRIFT-5283:
--

Hi,

I'm working on osquery rust bindings and the missing support of the thrift rust 
crate for Unix Domain Sockets is a blocker. I already patched a local copy of 
the Thrift crate to do a proof of concept for the binding library. However, 
when I tried to publish my crate yesterday to crates.io, cargo publish refused 
my crate due to the thrift dependency pointing to a local path.

I'm not a seasoned Rust developer. However, I'm willing to contribute to this 
issue and hope to get some help on the PR from the Thrift project.

[~ulidtko] : I'll investigate the approach you proposed. Okay?

Any other thoughts?

Thank you.

Tobias

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2021-03-05 Thread Prateek Kumar Nischal (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17296325#comment-17296325
 ] 

Prateek Kumar Nischal commented on THRIFT-5283:
---

Hi [~allengeorge], 
This functionality is not holding any important work at the moment. I guess it 
would just be a good idea to have the ability across all libraries.

Feel free to deprioritize this at the moment. I would really like to learn some 
more of this and try to send a PR :)

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2021-03-01 Thread Allen George (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17292887#comment-17292887
 ] 

Allen George commented on THRIFT-5283:
--

[~prateeknischal] Is adding this functionality still important to you?

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>  Components: Rust - Library
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Major
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2020-11-30 Thread Max (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17240702#comment-17240702
 ] 

Max commented on THRIFT-5283:
-

Hey [~prateeknischal]

Indeed, I can see the issue now. {{std::net::SocketAddr}} only represents IP 
addresses; and the said trait {{std::net::ToSocketAddrs}} can only _resolve to_ 
IP addresses. The approach I suggested would not work.

The recommended practice seems to be layering another enum which would union 
{{std::net::SocketAddr}}, {{std::os::unix::net::SocketAddr}} and whatever else 
connection mechanisms needed [potentially in the future], e.g. like is done 
here: 
[https://github.com/Azure/iot-identity-service/blob/main/http-common/src/connector.rs]

Within Thrift's architecture though, looks like 
{{thrift::transport::TIoChannel}} trait has an implementation to be written, 
for e.g. {{thrift::transport::TUnixSocketChannel}}.

So all I can say right now — it's not implemented. Bumping up the priority.


> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Minor
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2020-11-17 Thread Prateek Kumar Nischal (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17233411#comment-17233411
 ] 

Prateek Kumar Nischal commented on THRIFT-5283:
---

Hi [~ulidtko],

So, while calling {{Tserver.listen}}, I observed that it internally calls, 
{code}
TcpListener::bind(addr: T);
{code}

So, If we could have a {{std::net::ToSocketAddrs}} trait implemented for 
something, it would work. But the problem is, the trait needs the following 
definition
{code}
fn to_socket_addrs() -> Result>
{code}
and the {{std::net::SocketAddr}} enum only has 2 types, {{SocketAddrV4}} and 
{{SocketAddrV6}}.

I am not sure if we can represent a Unix socket into those types since it's 
looking for octets. 

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Minor
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (THRIFT-5283) Ability to listen over unix socket in thrift Rust crate

2020-10-16 Thread Max (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17215247#comment-17215247
 ] 

Max commented on THRIFT-5283:
-

Hi!

Sorry, I don't see any basis for this claim:
{quote}The API requires the trait 
[ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
be implemented which is not possible for a Unix Domain Socket. 
{quote}
Why is it not possible exactly?..

Take the most direct approach: import {{std::os::unix::net::SocketAddr}} and 
then write a trivial {{impl ToSocketAddrs for unix::SocketAddr}}.  Did you try 
that?

> Ability to listen over unix socket in thrift Rust crate
> ---
>
> Key: THRIFT-5283
> URL: https://issues.apache.org/jira/browse/THRIFT-5283
> Project: Thrift
>  Issue Type: New Feature
>Affects Versions: 0.13.0
>Reporter: Prateek Kumar Nischal
>Priority: Minor
>
> The rust crate for [thrift|https://crates.io/crates/thrift] right now has the 
> ability to create a server [but only over a TCP 
> socket|https://github.com/apache/thrift/blob/master/lib/rs/src/server/threaded.rs#L172].
> {code}
> pub fn listen( self, listen_address: A) -> 
> thrift::Result<()> 
> {code}
> The API requires the trait 
> [ToSocketAddrs|https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html] to 
> be implemented which is not possible for a Unix Domain Socket. 
> Other libraries, for example, python has an option to serve over unix 
> sockets. eg
> {code:python}
> TSocket.TServerSocket(unix_socket='/tmp/service.sock')
> {code}
> It would be really nice to be able to get a similar API in rust as well 
> unless there is a way to do it already. Please let me know if it already 
> exists.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)