Hello,
The code snippet reported at the end of this message causes an
IOException "connection refused failure"
Could anyone explain to me why this failure occurs, and how I could
instantiate a localsocket connection?
By the way, replacing
l = new LocalSocketAddress(SOCKET_NAME);
with
l = new LocalSocketAddress(SOCKET_NAME,
LocalSocketAddress.Namespace.FILESYSTEM);
causes an IOException "socket not created" failure.
Thanks.
Alex Donnini
LocalSocket s = null;
LocalSocketAddress l;
try {
Log.i(TAG, " instantiating local socket --- ");
s = new LocalSocket();
Log.i(TAG, "s --- "+s.toString());
//l = new LocalSocketAddress(SOCKET_NAME,
LocalSocketAddress.Namespace.FILESYSTEM);
l = new LocalSocketAddress(SOCKET_NAME);
s.connect(l);
} catch (IOException ex){
try
{
if (s != null) {
Log.i(TAG, " about to close socket after
IOException --- ");
ex.printStackTrace();
s.close();
}
else
{
Log.i(TAG, " socket is null ---
"+s.toString());
}
}
catch (IOException ex2)
{
Log.i(TAG, " failure to close after failure
to connect --- ");
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---