diff options
Diffstat (limited to 'CSharp/Ivy')
-rw-r--r-- | CSharp/Ivy/Ivy/Ivy.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/CSharp/Ivy/Ivy/Ivy.cs b/CSharp/Ivy/Ivy/Ivy.cs index b40b335..9ab06d7 100644 --- a/CSharp/Ivy/Ivy/Ivy.cs +++ b/CSharp/Ivy/Ivy/Ivy.cs @@ -397,19 +397,25 @@ namespace IvyBus /// </param>
public void start(string domainbus)
{
+ int ndx = 0;
+ IPAddress localaddr;
domainbus = getDomain(domainbus);
try
{
//TODO remove ALL reverse DNS search !!!!
- IPAddress localaddr = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0];
+ //TODO possible bug applicationhost = 127.0.0.1 and not IP
+ do
+ {
+ localaddr = Dns.GetHostEntry(Dns.GetHostName()).AddressList[ndx++];
+ } while (IPAddress.IsLoopback(localaddr));
app = new MyTcpListener(IPAddress.Any, 0);
- app.Start();
applicationPort = (ushort)((IPEndPoint) app.LocalEndpoint).Port;
applicationHost = localaddr;
applicationUniqueId = string.Format("{0}-{1}-{2}",
DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond,
localaddr.ToString().Replace(".",""),
applicationPort );
+ app.Start();
}
catch (IOException e)
{
@@ -885,6 +891,7 @@ namespace IvyBus * there might still be a lingering bug here, that we could avoid with the
* SchizoToken.
*/
+ //TODO bug multiple instance Reco car en 127.0.0.1
internal bool checkConnected(IvyClient clnt)
{
if (clnt.AppPort == 0)
|