Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
briar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Dehm
briar
Commits
116e1941
Commit
116e1941
authored
12 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Replace the modem instance if an exception occurs.
parent
14f2fd19
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/net/sf/briar/plugins/modem/ModemPlugin.java
+10
-7
10 additions, 7 deletions
src/net/sf/briar/plugins/modem/ModemPlugin.java
with
10 additions
and
7 deletions
src/net/sf/briar/plugins/modem/ModemPlugin.java
+
10
−
7
View file @
116e1941
...
...
@@ -88,14 +88,17 @@ class ModemPlugin implements DuplexPlugin, Modem.Callback {
// Synchronized to avoid a race condition with stop()
private
synchronized
boolean
resetModem
()
{
if
(!
running
)
return
false
;
try
{
modem
.
init
();
return
true
;
}
catch
(
IOException
e
)
{
if
(
LOG
.
isLoggable
(
WARNING
))
LOG
.
warning
(
e
.
toString
());
running
=
false
;
return
false
;
for
(
String
portName
:
SerialPortList
.
getPortNames
())
{
modem
=
modemFactory
.
createModem
(
this
,
portName
);
try
{
modem
.
init
();
return
true
;
}
catch
(
IOException
e
)
{
if
(
LOG
.
isLoggable
(
WARNING
))
LOG
.
warning
(
e
.
toString
());
}
}
running
=
false
;
return
false
;
}
public
boolean
shouldPoll
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment