thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jano Svitok (Jira)" <j...@apache.org>
Subject [jira] [Comment Edited] (THRIFT-5129) Swift TSocketTransport cannot be used to connect to client
Date Wed, 04 Mar 2020 10:17:00 GMT

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

Jano Svitok edited comment on THRIFT-5129 at 3/4/20, 10:16 AM:
---------------------------------------------------------------

In addition, conversion from Int to in_port_t is most probably not done properly, see THRIFT-5125

i.e.
{code:java}
sin_port: in_port_t(UInt16(truncatingIfNeeded: port).bigEndian), {code}
should be used for both linux and non-linux systems.


was (Author: janosvitok):
In addition, conversion from Int to in_port_t is most probably not done properly, see THRIFT-5125

i.e.
{code:java}
sin_port: in_port_t(UInt16(truncatingIfNeeded: port).bigEndian), {code}
should be used for bot linux and non-linux systems.

> Swift TSocketTransport cannot be used to connect to client
> ----------------------------------------------------------
>
>                 Key: THRIFT-5129
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5129
>             Project: Thrift
>          Issue Type: Bug
>          Components: Swift - Library
>    Affects Versions: 0.14.0
>            Reporter: Caner Burak Ongay
>            Priority: Major
>              Labels: newbie
>
> TLDR; Swift library cannot be used to connect to a client using TSocketTransport with
present code.
> In TSocketTransport init, socket IP is not set for non-linux systems, so TSocketTransport
cannot be used to connect clients.
> It is set as: `in_addr(s_addr: in_addr_t(0))` in line TSocketTransport.swift 162.
> {code:java}
> var addr = sockaddr_in(sin_len: UInt8(MemoryLayout<sockaddr_in>.size),
>                        sin_family: sa_family_t(AF_INET),
>                        sin_port: in_port_t(htons(UInt16(port))),
>                        sin_addr: in_addr(s_addr: in_addr_t(0)),
>                        sin_zero: (0, 0, 0, 0, 0, 0, 0, 0))
> {code}



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

Mime
View raw message