not getting offline messages with smack - android

I am trying a chat application with openfire,smack and android where offline messages are not working. if both the users are online, able to send and receive the messages correctly . But if user A is offline and user B sends a message, User A is not getting the sent message of B once he is online.Tried possible solutions from stackoverflow but none of them working. using the below code to retrieve the offline messages.
new Thread(){
public void run(){
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
.setSocketFactory(SocketFactory.getDefault())
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
.setServiceName("123.456.0.854")//service name
.setHost("123.456.0.854") // host name
.setPort(5222) //port
.setUsernameAndPassword("phone", "admin")
.setConnectTimeout(40000)
.setCompressionEnabled(false).build();
connection = new XMPPTCPConnection(config);
try {
connection.connect();
connection.login("phone", "admin");
Presence presence = new Presence(Presence.Type.available);
presence.setStatus("Available");
try {
connection.sendStanza(presence);
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
}
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XMPPException e) {
e.printStackTrace();
}
OfflineMessageManager offlineMessageManager = new OfflineMessageManager(connection);
try {
System.out.println("Count is " +offlineMessageManager.getMessageCount());
} catch (SmackException.NoResponseException e) {
e.printStackTrace();
} catch (XMPPException.XMPPErrorException e) {
e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
}
}
}.start();

After lot struggle, I have resolved the issue. In your openfire admin page, go to "client settings" and reduce the idle time from 360sec (by default) to 1 sec(may be). Only then when you disconnected from Internet, it can detect that you are offline and preserve rest of the messages as OFFLINE.
#Override public void onNetworkConnectionChanged(boolean isConnected) {
if(isConnected){
new Thread() {
public void run() {
try {
XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();
builder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
builder.setUsernameAndPassword("phone", "admin");
builder.setSendPresence(true);
builder.setServiceName(<Service name>);
builder.setHost(<Host name>);
builder.setResource("Test");
builder.setDebuggerEnabled(true);
Presence presence = new Presence(Presence.Type.available);
presence.setStatus("Available");
connection = new XMPPTCPConnection(builder.build());
connection.connect();
connection.login();
Presence presence123 = new Presence(Presence.Type.available);
presence123.setStatus("Available");
try {
connection.sendStanza(presence123);
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
}
StanzaFilter filter = new AndFilter(new StanzaTypeFilter(Message.class));
PacketListener myListener = new PacketListener()
{
public void processPacket(Stanza stanza)
{
retrieveMessage(stanza,userType);
}
};
connection.addPacketListener(myListener, filter);
try {
connection.sendStanza(presence);
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
}
} catch (SmackException | XMPPException | IOException e) {
e.printStackTrace();
}
//return connection.isConnected();
}
}.start();
The above is working fine and able to retrieve the offline messages. The method "retrieveMessage(stanza,userType);" is used to process the incoming message and update the Adapter. Make sure to send the Presence as "Available" when you reconnect. Please let me know if there are still any issues.

Related

Connection is disconnecting when mobile is going offline and then not getting offline message in Smack (xmpp)

I am trying to achieve the offline message when i got online again in Smack
this is my connection code I am able to reconnect and continue the chat also but not getting the offline message in Had use OfflineManager also but it is howing zero message...
public void connectConnection() {
AsyncTask<Void, Void, Boolean> connectionThread = new AsyncTask<Void, Void, Boolean>() {
#Override
protected Boolean doInBackground(Void... arg0) {
// Create a connection
try {
connection.connect();
login();
connected = true;
scheduleTaskExecutor = Executors.newSingleThreadScheduledExecutor();
scheduleTaskExecutor.scheduleWithFixedDelay(new Runnable() {
#Override
public void run() {
Log.e("xmpp", "inside run()");
Log.d("xmpp", "isconnect: " + connection.isConnected() + " Auth: " + connection.isAuthenticated());
Log.d("xmpp", "getPacketReplyTimeout: "+String.valueOf(connection.getPacketReplyTimeout()));
SettingStore ss=new SettingStore(getApplicationContext());
if (ss.getStartChatValue()){
try {
Presence presence = new Presence(Presence.Type.available);
connection.sendPacket(presence);
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
}
if (connection.isConnected()) {
sendMessagesToServer();
} else {
try {
connection.connect();
login();
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XMPPException e) {
e.printStackTrace();
}
}
}
else {
disconnectAndStopTimmer();
}
}
}, 0, 2, TimeUnit.SECONDS);
} catch (IOException e) {
} catch (SmackException e) {
} catch (XMPPException e) {
}
return null;
}
};
connectionThread.execute();
}
I am gitting connection time out error
09-30 19:07:20.796 10323-10382/? W/AbstractXMPPConnection: Connection closed with error
javax.net.ssl.SSLException: Read error: ssl=0x60fefe48: I/O error during system call, Connection timed out
at com.android.org.conscrypt.NativeCrypto.SSL_read(Native Method)
at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:690)
at java.io.InputStreamReader.read(InputStreamReader.java:233)
at java.io.BufferedReader.read(BufferedReader.java:325)
at org.kxml2.io.KXmlParser.fillBuffer(KXmlParser.java:1506)
at org.kxml2.io.KXmlParser.peekType(KXmlParser.java:986)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:346)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:310)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1164)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:944)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:959)
at java.lang.Thread.run(Thread.java:862)
09-30 19:07:20.796 10323-10382/? D/xmpp: ConnectionClosedOn Error!
move your connection to background service so it is always connected.
in openfire, there is option for resending offline messages
server > server settings > offline messages
Store offline messages for later retrieval. Messages will be delivered the next time the recipient logs in.
this will automatically send the message again when the user gets connected to xmpp

Error while trying to connect openfire using smack on android

XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder();
configBuilder.setUsernameAndPassword("test", "test");
configBuilder.setResource("test");
configBuilder.setServiceName("37.139.26.142");
configBuilder.setHost("37.139.26.142");
configBuilder.setPort(5222);
configBuilder.setSendPresence(true);
configBuilder.setDebuggerEnabled(true);
configBuilder.setSecurityMode(XMPPTCPConnectionConfiguration.SecurityMode.required );
SASLMechanism mechanism = new SASLDigestMD5Mechanism();
SASLAuthentication.registerSASLMechanism(mechanism);
SASLAuthentication.blacklistSASLMechanism("SCRAM-SHA-1");
SASLAuthentication.unBlacklistSASLMechanism("DIGEST-MD5");
AbstractXMPPConnection connection = new XMPPTCPConnection(configBuilder.build());
try {
connection.connect();
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XMPPException e) {
e.printStackTrace();
}
try {
connection.login();
} catch (XMPPException e) {
e.printStackTrace();
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
I'm currently trying to handshake my android application and my openfire server(working on ubuntu). But I couldnt. I dont get any fail or something. Just nothing happens. And that feels bad.
Did you try to send a message? Are you sure that you are not connected?
Did you check on Openfire admin that your test user is not connected?
First I suggest you to try to send a message:
ChatManager chatmanager = ChatManager.getInstanceFor(connection);
Chat newChat = chatmanager.createChat("anotheruser#yourdomain", new MessageListener() {
public void processMessage(Chat chat, Message message) {
System.out.println("Received message: " + message);
}
});
try {
newChat.sendMessage("Howdy!");
}
catch (XMPPException e) {
System.out.println("Error Delivering block");
}
I got this code from : http://www.igniterealtime.org/builds/smack/docs/latest/documentation/messaging.html
Another suggestion is to disable the SecurityMode, just for a test.
configBuilder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
If nothing of this works, try to use the configuration below, which works for me.
XMPPTCPConnectionConfiguration.Builder config = XMPPTCPConnectionConfiguration.builder();
config.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
config.setServiceName(serverAddress);
config.setHost(serverAddress);
config.setPort(5222);
config.setDebuggerEnabled(true);
connection = new XMPPTCPConnection(config.build());
try {
connection.connect();
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XMPPException e) {
e.printStackTrace();
}
try {
connection.login(loginUser, passwordUser);
} catch (XMPPException e) {
e.printStackTrace();
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
First I find out this is not about Android part, this is about Openfire part. Because I couldnt connect it with Spark and I saw this in Logcat;
W/System.err: org.jivesoftware.smack.SmackException$ConnectionException: The following addresses failed: '37.139.26.142:5222' failed because java.net.SocketTimeoutException: failed to connect to /37.139.26.142 (port 5222) after 30000ms
Then I did some research and tried somethings and I saw it is about Ubuntu(at least for me). Then I moved my openfire server to Centos. Then I could be able to connect with Spark to it. Then I got another problem.
org.jivesoftware.smack.SmackException: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
And I solved this problem with this code below. I hope this can help others.
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
SmackConfiguration.DEBUG = true;
XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder();
configBuilder.setUsernameAndPassword("test", "test");
configBuilder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
configBuilder.setResource("test");
configBuilder.setServiceName("enter your server ip here");
configBuilder.setHost("eneter your server ip here");
configBuilder.setPort(5222);
configBuilder.setSendPresence(true);
configBuilder.setDebuggerEnabled(true);
SASLAuthentication.blacklistSASLMechanism("SCRAM-SHA-1");
SASLAuthentication.blacklistSASLMechanism("DIGEST-MD5");
SASLAuthentication.unBlacklistSASLMechanism("PLAIN");
XMPPTCPConnection connection;
connection = new XMPPTCPConnection(configBuilder.build());
// Connect to the server
try {
connection.connect();
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XMPPException e) {
e.printStackTrace();
}
// Log into the server
try {
connection.login();
} catch (XMPPException e) {
e.printStackTrace();
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}

Smack 4.1 anonymous registration to Openfire

I have tried enough but getting error when trying to register a user through smack 4.1 on openfire server without any login (anonymous). With a user login, the registration works fine.
I have already checked Smack 4.1 Android anonymous registration to Openfire link but still getting the same error (Bad Request - Modify).
<iq type="error" id="R6rBt-3" from="192.168.0.105" to="desktop-ebr9dof/a96febd1"><query xmlns="jabber:iq:register"><username>user4</username><password>uhifg123</password></query><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
below is the code snippet I've applied in my code:
XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder();
configBuilder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
configBuilder.setServiceName("192.168.0.105");
configBuilder.setHost("192.168.0.105");
configBuilder.setPort(5222);
configBuilder.setDebuggerEnabled(true);
configBuilder.setCompressionEnabled(false);
configBuilder.setSendPresence(true);
configBuilder.setUsernameAndPassword("user4", "uhifg123");
XMPPTCPConnection connection = new XMPPTCPConnection(configBuilder.build());
try {
connection.connect();
AccountManager accountManager = AccountManager.getInstance(connection);
accountManager.sensitiveOperationOverInsecureConnection(true);
Map<String, String> map = new HashMap<String, String>();
map.put("username", "user4");
map.put("password", "uhifg123");
SASLAuthentication.unBlacklistSASLMechanism("PLAIN");
SASLAuthentication.blacklistSASLMechanism("DIGEST-MD5");
try {
accountManager.createAccount("user4", "uhifg123", map);
} catch (SmackException.NoResponseException e) {
e.printStackTrace();
} catch (XMPPException.XMPPErrorException e) {
e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
}
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XMPPException e) {
e.printStackTrace();
}

Duplicate messages receiving in android smack 4.1

I have been trying to create an android chat app using smack 4.1. Message sending and receiving is working fine, but the problem is same message is getting several times with in the mXmppConnection.addAsyncStanzaListener.I don't know if i have missed to add something to the connection.
This is my connection class:
XMPPTCPConnectionConfiguration.Builder configBuilder = new XMPPTCPConnectionConfiguration.builder();
configBuilder.setUsernameAndPassword(mUser, "password#123");
configBuilder.setPort(5555);
configBuilder.setServiceName("tvm.myname.com");
configBuilder.setDebuggerEnabled(true); configBuilder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
try
{
XMPPTCPConnection mConnection = new XMPPTCPConnection(configBuilder.build());
mConnection.connect();
mConnection.login();
}
catch (SmackException e)
{
}
And this the code where message receives:
mXmppConnection.addAsyncStanzaListener(new StanzaListener() {
#Override
public void processPacket(Stanza packet) throws SmackException.NotConnectedException {
Message message = (Message)packet;
Log.i("XMPPClient", "****** message " + message);
// code for handling message
} `enter code here`
},null);
The real problem is i am getting the message several times..the value of message is printing in the logs several time. Please help me....
FINALLY GOT SOLUTION
The issue is not with the client but due to careless coding. I have been assigning single instance of connection object to a class variable and listener is adding to these reference object every time. So that leads to calling listener multiple times....The fix is done by adding listener to the singleton connection object.
I don't know is there any best approach for keeping the xmpp connection stable through out the application.If anyone knows a better solution please post the answer here. I am using a global connection variable, all the chat operations are done by making use of this static connection variable. This is working for me.
For sending and receiving messages using smack we need to make connection with xmpp server.
public static AbstractXMPPConnection getInstance(Context context) {
mContext = context;
sendMessageCallBack = (XmppSendMessageCallBack) context;
if (mConnection == null) {
mInstance = new XmppClient();
mUser = new Preferences(context).getPhone();
setUserToServer();
}
return mConnection;
}
private static void setUserToServer() {
new Thread(new Runnable() {
#Override
public void run() {
try {
Looper.prepare();
/** connecting to server ***/
XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder();
configBuilder.setServiceName(Constants.HOST_URL);
configBuilder.setDebuggerEnabled(true);
configBuilder.setSendPresence(true);
configBuilder.setConnectTimeout(XMPPTCPConnectionConfiguration.DEFAULT_CONNECT_TIMEOUT);
configBuilder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
String[] sslProtocols = {"starttls"
, "no_sslv3"
, "no_tlsv1"};
configBuilder.setEnabledSSLProtocols(sslProtocols);
mConnection = new XMPPTCPConnection(configBuilder.build());
mConnection.setPacketReplyTimeout(120000);
mConnection.connect();
// Log into the server
if(mConnection!=null) {
mConnection.login(mUser, "password#123");
reConnectionSetUp();
PingManager pingManager = PingManager.getInstanceFor(mConnection);
pingManager.setPingInterval(60000);
pingManager.pingMyServer();
pingManager.registerPingFailedListener(new PingFailedListener() {
#Override
public void pingFailed() {
if (mConnection != null && !mConnection.isConnected())
setUserToServer();
}
});
setUpListenersForXmppConnection(mConnection);
}
} catch (SmackException.ConnectionException e) {
Log.e("XmppClient", "ConnectionException :", e);
Toast.makeText(mContext,"failed to connect to server",Toast.LENGTH_SHORT).show();
} catch (SmackException.NoResponseException e) {
Log.e("XmppClient", "NoResponseException :", e);
Toast.makeText(mContext,"Connection time out please try again",Toast.LENGTH_SHORT).show();
} catch (XMPPException e) {
Log.e("XmppClient", "XMPPException :", e);
}catch (IOException e) {
Log.e("XmppClient", "IOException :", e);
}catch (SmackException.NotConnectedException e) {
Log.e("XmppClient", "NotConnectedException :", e);
reConnectionSetUp();
}catch (SmackException e) {
Log.e("XmppClient", "SmackException :", e);
}catch (NullPointerException e) {
Log.e("XmppClient", "NullPointerException :", e);
}
}
}).start();
}
private static void setUpListenersForXmppConnection(AbstractXMPPConnection xmppConnection){
try {
if(xmppConnection!=null) {
sendOnlineStatus();
/** adding connection listener **/
xmppConnection.addConnectionListener(mInstance);
/** adding privacy manager to connection **/
if(xmppConnection!=null)
mPrivacyListManager = PrivacyListManager.getInstanceFor(xmppConnection);
/** adding packet listener for receving incoming packets **/
StanzaFilter filter = MessageTypeFilter.NORMAL;
if(xmppConnection!=null && mInstance!=null)
xmppConnection.addSyncStanzaListener(mInstance, null);
}
} catch (SmackException e) {
Log.e("XmppClient", "IOException :", e);
} catch (XMPPException e) {
Log.e("XmppClient", "XMPPException :", e);
e.printStackTrace();
} catch (NullPointerException e) {
Log.e("XmppClient", "NullPointerException :", e);
} catch (ConcurrentModificationException e){
Log.e("XmppClient", "ConcurrentModificationException :", e);
} catch (IllegalArgumentException e){
e.printStackTrace();
}catch (RetrofitError e){
Log.e("XmppClient", "RetrofitError :", e);
}
}
When we receive a message the following method will be invoked
#Override
public void processPacket(Stanza packet) throws SmackException.NotConnectedException {
if(packet instanceof Message) {
Message message = (Message) packet;
// Do your task
}
}
We can send message by creating a message object of smack like this,
Message message = new Message();
message.setFrom(senderId);
message.setBody(body);
message.setSubject(subject);
message.setTo(receiverId);
try {
if(mConnection!=null){
ChatManager chatManager = ChatManager.getInstanceFor(mConnection);
if(chatManager!=null){
chatManager.createChat(message.getTo(), new ChatStateListener() {
#Override
public void stateChanged(Chat chat, ChatState state) {
Log.e("XMPPClient", "******* stateChanged "+state);
}
#Override
public void processMessage(Chat chat, Message message) {
Log.e("XMPPClient", "******* processMessage "+message.getSubject());
}
}).sendMessage(message);
}
}
sendMessageCallBack.messageSuccessfullySend(message.getStanzaId(), status);
}catch (SmackException.NotConnectedException e){
Log.e("XMPPClient", "******* NotConnectedException ", e);
sendMessageCallBack.messageSendingFailed("");
}catch(NullPointerException e){
Log.e("XMPPClient", "******* NullPointerException ", e);
sendMessageCallBack.messageSendingFailed("");
}catch (Exception e){
sendMessageCallBack.messageSendingFailed("No Network");
}
Same problem I have faced but I got the solution, you don't unregistered your BroadcastReceiver when you logout from app below is code of logout and also you make all the connection is singleton.
try {
Presence pr=new Presence(Presence.Type.unavailable);
pr.setStatus(RoosterConnection.getConnection().getUser() + "false");
RoosterConnection.getConnection().sendStanza(pr);
if (mConnection != null) {
mConnection.disconnect();
}
// mBus.unregister(this);
mConnection = null;
// Unregister the message broadcast receiver.
if (uiThreadMessageReceiver != null) {
mApplicationContext.unregisterReceiver(uiThreadMessageReceiver);
uiThreadMessageReceiver = null;
}
Intent intent = new Intent(this,LoginActivity.class);
startActivity(intent);
finish();}catch(SmackException.NotConnectedException e){ e.printStackTrace();}catch(InterruptedException e){
e.printStackTrace();}
Just use addSyncStanzaListener instead addAsyncStanzaListener

exception while trying to receive a file from server

i run some code to connect to a server, send it an Object and then receive another Object.
while running this on my Android enulator (v2.2) i get - java.net.SocketException: Socket is closed
the connection to the server is successful and i'm able to send the object but when i'm trying to do socket.getInputStream() it throws the exception
this is my connector class:
public class ConnectionToServer {
UserProblemRequest sentProblem;
Problem responseProblem;
Socket socket;
public ConnectionToServer(){
sentProblem = null;
responseProblem = null;
socket = null;
}
public void connect(){
try {
Log.d(TAG, "Connecting...");
socket = new Socket(Utils.SERVER_IP, Utils.SERVER_PORT);
Log.d(TAG, "SUCCESS: Connected!");
} catch (UnknownHostException e) {
Log.d(TAG, "ERROR: Falied to connect! (UnknownHostException)");
e.printStackTrace();
} catch (IOException e) {
Log.d(TAG, "ERROR: Falied to connect! (IOException)");
e.printStackTrace();
}
}
public void setProblemFromByteArray(byte[] data, boolean isFile){
sentProblem = new UserProblemRequest();
sentProblem.fileBArray = data.clone();
if (isFile){
sentProblem.requestType = Utils.requestType_IMAGE;
}
else {
sentProblem.requestType = Utils.RequestType_STRING;
}
}
public void sendProblem(){
ObjectOutputStream os;
try {
os = new ObjectOutputStream(socket.getOutputStream());
Log.d(TAG, "Sending file to server...");
os.writeObject(sentProblem);
os.flush();
os.close();
} catch (IOException e) {
Log.d(TAG, "ERROR: Falied to send file to server!");
e.printStackTrace();
}
Log.d(TAG, "SUCCESS: File sent to server!");
}
public void closeConnection(){
try {
socket.close();
} catch (IOException e) {
Log.d(TAG, "failed to close socket");
e.printStackTrace();
}
}
public Problem reciveResponseFromServer(){
ObjectInputStream ois;
try {
ois = new ObjectInputStream(socket.getInputStream());
responseProblem = (Problem) ois.readObject();
} catch (StreamCorruptedException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
return responseProblem;
}
}
and i use this code to run it:
ConnectionToServer serverConnection = new ConnectionToServer();
serverConnection.connect();
serverConnection.setProblemFromByteArray(temp_data, true);
serverConnection.sendProblem();
Problem responseProblem = serverConnection.reciveResponseFromServer();
serverConnection.closeConnection();
any ideas?
Does closing the ObjectOutputStream() in sendProblem() wind up closing the underlying socket so that when you getInputStream() in reciveResponseFromServer() the socket is already closed?

Categories

Resources