Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
a827f765
Commit
a827f765
authored
May 04, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(unet2): добавил вылавливание исключений при создании соединения.
Подправил логи об ошибке. Немного подправил документацию.
parent
b4aa6065
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
7 deletions
+23
-7
UNetExchange.h
extensions/UNet2/UNetExchange.h
+3
-1
UNetReceiver.cc
extensions/UNet2/UNetReceiver.cc
+10
-4
UNetSender.cc
extensions/UNet2/UNetSender.cc
+10
-2
No files found.
extensions/UNet2/UNetExchange.h
View file @
a827f765
...
@@ -30,8 +30,10 @@
...
@@ -30,8 +30,10 @@
\par Пример конфигурирования
\par Пример конфигурирования
По умолчанию при считывании используются свойства \a ip и \a id - в качестве порта.
По умолчанию при считывании используются свойства \a ip и \a id - в качестве порта.
Но можно переопределять эти параметры, при помощи указания \a unet_port и/или \a unet_ip.
Но можно переопределять эти параметры, при помощи указания \a unet_port и/или \a unet_ip.
Помимо этого можно задать broadcast-адрес по умолчанию \a unet_ip для всех узлов в
свойствах секции <nodes unet_ip="xxx.255">
\code
\code
<nodes port="2809">
<nodes port="2809"
unet_ip="192.168.56.255"
>
<item ip="127.0.0.1" name="LocalhostNode" textname="Локальный узел" unet_ignore="1" unet_port="3000" unet_ip="192.168.56.1">
<item ip="127.0.0.1" name="LocalhostNode" textname="Локальный узел" unet_ignore="1" unet_port="3000" unet_ip="192.168.56.1">
<iocards>
<iocards>
...
...
...
...
extensions/UNet2/UNetReceiver.cc
View file @
a827f765
...
@@ -52,12 +52,18 @@ cache_init_ok(false)
...
@@ -52,12 +52,18 @@ cache_init_ok(false)
catch
(
ost
::
SockException
&
e
)
catch
(
ost
::
SockException
&
e
)
{
{
ostringstream
s
;
ostringstream
s
;
s
<<
e
.
getString
()
<<
": "
<<
e
.
getSystemErrorString
();
s
<<
"("
<<
s_host
<<
":"
<<
port
<<
"): "
<<
e
.
getString
()
<<
": "
<<
e
.
getSystemErrorString
();
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(init): "
<<
s
.
str
()
<<
std
::
endl
;
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(init): (ost::SocketException) "
<<
s
.
str
()
<<
std
::
endl
;
throw
SystemError
(
s
.
str
());
throw
SystemError
(
s
.
str
());
}
}
catch
(
ost
::
Socket
&
socket
)
{
ostringstream
s
;
s
<<
"Could not create connection for "
<<
s_host
<<
":"
<<
port
;
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(init): (ost::Socket) "
<<
s
.
str
()
<<
std
::
endl
;
throw
SystemError
(
s
.
str
());
}
r_thr
=
new
ThreadCreator
<
UNetReceiver
>
(
this
,
&
UNetReceiver
::
receive
);
r_thr
=
new
ThreadCreator
<
UNetReceiver
>
(
this
,
&
UNetReceiver
::
receive
);
u_thr
=
new
ThreadCreator
<
UNetReceiver
>
(
this
,
&
UNetReceiver
::
update
);
u_thr
=
new
ThreadCreator
<
UNetReceiver
>
(
this
,
&
UNetReceiver
::
update
);
...
...
extensions/UNet2/UNetSender.cc
View file @
a827f765
...
@@ -45,10 +45,18 @@ s_thr(0)
...
@@ -45,10 +45,18 @@ s_thr(0)
catch
(
ost
::
SockException
&
e
)
catch
(
ost
::
SockException
&
e
)
{
{
ostringstream
s
;
ostringstream
s
;
s
<<
e
.
getString
()
<<
": "
<<
e
.
getSystemErrorString
()
<<
endl
;
s
<<
"("
<<
s_host
<<
":"
<<
port
<<
"): "
<<
e
.
getString
()
<<
": "
<<
e
.
getSystemErrorString
();
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(init): (ost::SocketException) "
<<
s
.
str
()
<<
std
::
endl
;
throw
SystemError
(
s
.
str
());
throw
SystemError
(
s
.
str
());
}
}
catch
(
ost
::
Socket
&
socket
)
{
ostringstream
s
;
s
<<
"Could not create connection for "
<<
s_host
<<
":"
<<
port
;
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(init): (ost::Socket) "
<<
s
.
str
()
<<
std
::
endl
;
throw
SystemError
(
s
.
str
());
}
s_thr
=
new
ThreadCreator
<
UNetSender
>
(
this
,
&
UNetSender
::
send
);
s_thr
=
new
ThreadCreator
<
UNetSender
>
(
this
,
&
UNetSender
::
send
);
// -------------------------------
// -------------------------------
...
...
Write
Preview
Markdown
is supported
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