Jump to content

Pas d’IOException lancée après la fermeture d’un socket


Fractal

Recommended Posts

Bonjour,

Peut-être que c’est moi qui ai mal compris quelque chose, mais j’ai un problème bizarre avec les sockets.

Depuis mon téléphone, mon application se connecte à un serveur (qui tourne sur mon ordinateur), elle récupère un BufferedInputStream et un BufferedOutputStream pour dialoguer avec lui avec write() et read(), et tout marche comme il faut.

Mais maintenant si je kille le serveur alors que mon téléphone y est connecté, la fonction read() semble bloquer indéfiniment et la fonction write() envoie les trucs dans le vide sans s’apercevoir qu’il n’y a plus personne au bout.

Je m’attendais plutôt à ce qu’ils renvoient l’exception IOException, mais visiblement non.

Que se passe-t-il ?

Merci :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...