Hi, Thanks Chris, yeah that's what I ended up doing, thanks.
Ben On Sat, Jan 7, 2023 at 8:46 PM Christofer Dutz <[email protected]> wrote: > Hi all and sorry for being late to the party .. > > I do think we had some reasoning behind not having this information in the > Configuration. But it should also be possible to access the information in > the driver. > For example, in the ADS driver in the code for setting up the AMS routes I > use this code to access the properties: > > > SocketAddress localSocketAddress = context.getChannel().localAddress(); > InetAddress localAddress = ((InetSocketAddress) > localSocketAddress).getAddress(); > > Perhaps that helps? > > Chris > > > > From: jl hong <[email protected]> > Date: Saturday, 7. January 2023 at 10:46 > To: [email protected] <[email protected]> > Subject: Re: Extending Configuration to include Connection String > Hi Ben, > > In your case, it seems like a good idea to keep them in the > Configuration.😎 > > Jinlin > > Ben Hutcheson <[email protected]> 於 2023年1月7日 週六 下午5:37寫道: > > > Hi Jinlin, > > > > Yeah we do parse the string and get those values, however currently we > > don't save them in the configuration for later use. > > > > Although I have been playing around this morning with getting the values > > from the netty channel that is created. I might just use this instead. > > > > thanks > > > > Ben > > > > On Sat, Jan 7, 2023 at 10:28 AM jl hong <[email protected]> wrote: > > > > > Hi Ben, > > > > > > I see we parse the connection string as a URL, and it contains IP, > port, > > > and protocol. Did you mean we needn’t parse it again? > > > > > > Jinlin > > > > > > Ben Hutcheson <[email protected]> 於 2023年1月7日 週六 下午3:05寫道: > > > > > > > Hi, > > > > > > > > There's been a few times where I have had to pass the connection > string > > > > information through to the driver logic to be used in the connection > > > phase. > > > > For OPC-UA it's passed as a string through to the OPCUA device to > help > > > > select the correct endpoint. As well as now in the Profinet driver as > > we > > > > need to create multiple sockets and use multiple protocols to create > > the > > > > connection, some of which we need to know what interface we would > like > > to > > > > listen on. > > > > > > > > I propose to extend the Configuration interface to include the > > connection > > > > string information such as the ip address, port and transport. This > way > > > I'm > > > > not recreating the getConnection logic for each driver. > > > > > > > > What are peoples thoughts? > > > > > > > > Ben > > > > > > > > > >
