Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Teemu Auvinen
DTEK1066-ryhmis
Commits
611dd428
Commit
611dd428
authored
Nov 27, 2017
by
Matti Pulkkinen
Browse files
throw IOException out of openObjectStreams()
parent
fadf2a1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
DTEK1066-ryhmis/src/fi/utu/dtek1066/SocketHandler.java
View file @
611dd428
...
...
@@ -77,8 +77,9 @@ public class SocketHandler {
*
* @param ois
* @param oos
* @throws IOException if opening one of the sockets fails.
*/
public
void
openObjectStreams
(
ObjectInputStream
ois
,
ObjectOutputStream
oos
)
{
public
void
openObjectStreams
(
ObjectInputStream
ois
,
ObjectOutputStream
oos
)
throws
IOException
{
int
timesRetried
=
0
;
do
{
this
.
sendPortNumber
(
REMOTEHOST
,
REMOTEPORT
,
LOCALPORT
);
...
...
@@ -97,10 +98,6 @@ public class SocketHandler {
}
catch
(
SocketTimeoutException
ex
)
{
System
.
err
.
println
(
"Socket timed out, trying again..."
);
timesRetried
++;
}
catch
(
IOException
e
)
{
System
.
err
.
println
(
"Failed in opening object streams."
);
e
.
printStackTrace
();
break
;
}
}
while
(
timesRetried
<
MAXRETRIES
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment