git-svn-id: svn://db.shs.com.ru/pip@118 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
project(pip)
|
project(pip)
|
||||||
cmake_minimum_required(VERSION 2.6)
|
cmake_minimum_required(VERSION 2.6)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -pg")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
|
||||||
|
|
||||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
include(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ PIBaseTransfer::PIBaseTransfer(): crc(standardCRC_16()), diag(false) {
|
|||||||
timeout_ = 10.;
|
timeout_ = 10.;
|
||||||
diag.setDisconnectTimeout(timeout_);
|
diag.setDisconnectTimeout(timeout_);
|
||||||
//CONNECTU(&diag, qualityChanged, this, diagChanged);
|
//CONNECTU(&diag, qualityChanged, this, diagChanged);
|
||||||
|
diag.start(100);
|
||||||
packets_count = 32;
|
packets_count = 32;
|
||||||
setPacketSize(4096);
|
setPacketSize(4096);
|
||||||
randomize();
|
randomize();
|
||||||
@@ -150,7 +151,7 @@ void PIBaseTransfer::received(PIByteArray data) {
|
|||||||
replies.resize(sr.packets + 1);
|
replies.resize(sr.packets + 1);
|
||||||
replies.fill(pt_Unknown);
|
replies.fill(pt_Unknown);
|
||||||
diag.reset();
|
diag.reset();
|
||||||
diag.start(100);
|
// diag.start(100);
|
||||||
//piCoutObj << "receiveStarted()";
|
//piCoutObj << "receiveStarted()";
|
||||||
is_receiving = true;
|
is_receiving = true;
|
||||||
break_ = false;
|
break_ = false;
|
||||||
@@ -188,7 +189,7 @@ bool PIBaseTransfer::send_process() {
|
|||||||
packet_header_size = sizeof(PacketHeader) + customHeader().size();
|
packet_header_size = sizeof(PacketHeader) + customHeader().size();
|
||||||
break_ = false;
|
break_ = false;
|
||||||
diag.reset();
|
diag.reset();
|
||||||
diag.start(100);
|
// diag.start(100);
|
||||||
sendStarted();
|
sendStarted();
|
||||||
is_sending = true;
|
is_sending = true;
|
||||||
replies.resize(session.size() + 1);
|
replies.resize(session.size() + 1);
|
||||||
@@ -451,7 +452,7 @@ bool PIBaseTransfer::finish_send(bool ok) {
|
|||||||
if (!ok) sendBreak(header.session_id);
|
if (!ok) sendBreak(header.session_id);
|
||||||
else sendReply(pt_ReplySuccess);
|
else sendReply(pt_ReplySuccess);
|
||||||
sendFinished(ok);
|
sendFinished(ok);
|
||||||
diag.stop();
|
// diag.stop();
|
||||||
bytes_all = bytes_cur = 0;
|
bytes_all = bytes_cur = 0;
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@@ -464,7 +465,7 @@ void PIBaseTransfer::finish_receive(bool ok, bool quet) {
|
|||||||
//piCoutObj << state_string << PIString::readableSize(bytes_all);
|
//piCoutObj << state_string << PIString::readableSize(bytes_all);
|
||||||
if (!ok && !quet) sendBreak(header.session_id);
|
if (!ok && !quet) sendBreak(header.session_id);
|
||||||
receiveFinished(ok);
|
receiveFinished(ok);
|
||||||
diag.stop();
|
// diag.stop();
|
||||||
bytes_all = bytes_cur = 0;
|
bytes_all = bytes_cur = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ PIString getSockAddr(sockaddr * s) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
REGISTER_DEVICE(PIEthernet);
|
REGISTER_DEVICE(PIEthernet)
|
||||||
|
|
||||||
|
|
||||||
PRIVATE_DEFINITION_START(PIEthernet)
|
PRIVATE_DEFINITION_START(PIEthernet)
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ void PIPeer::timerEvent(void * data, int delim) {
|
|||||||
|
|
||||||
|
|
||||||
void PIPeer::initEths(PIStringList al) {
|
void PIPeer::initEths(PIStringList al) {
|
||||||
|
piCoutObj << "initEths start";
|
||||||
PIEthernet * ce;
|
PIEthernet * ce;
|
||||||
const PIEthernet::Interface * cint = 0;
|
const PIEthernet::Interface * cint = 0;
|
||||||
piForeachC (PIString & a, al) {
|
piForeachC (PIString & a, al) {
|
||||||
@@ -214,10 +215,12 @@ void PIPeer::initEths(PIStringList al) {
|
|||||||
eth_send.setDebug(false);
|
eth_send.setDebug(false);
|
||||||
eth_send.setName("__S__PIPeer_traffic_eth_send");
|
eth_send.setName("__S__PIPeer_traffic_eth_send");
|
||||||
eth_send.setParameters(0);
|
eth_send.setParameters(0);
|
||||||
|
piCoutObj << "initEths ok";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PIPeer::initMBcasts(PIStringList al) {
|
void PIPeer::initMBcasts(PIStringList al) {
|
||||||
|
piCoutObj << "initMBcasts start";
|
||||||
destroyMBcasts();
|
destroyMBcasts();
|
||||||
PIEthernet * ce;
|
PIEthernet * ce;
|
||||||
const PIEthernet::Interface * cint;
|
const PIEthernet::Interface * cint;
|
||||||
@@ -270,6 +273,7 @@ void PIPeer::initMBcasts(PIStringList al) {
|
|||||||
}
|
}
|
||||||
if (eths_mcast.isEmpty()) piCoutObj << "Warning! Can`t find suitable network interface for multicast receive, check for exists at least one interface with multicasting enabled!";
|
if (eths_mcast.isEmpty()) piCoutObj << "Warning! Can`t find suitable network interface for multicast receive, check for exists at least one interface with multicasting enabled!";
|
||||||
if (eths_bcast.isEmpty()) piCoutObj << "Warning! Can`t find suitable network interface for broadcast receive, check for exists at least one interface with broadcasting enabled!";
|
if (eths_bcast.isEmpty()) piCoutObj << "Warning! Can`t find suitable network interface for broadcast receive, check for exists at least one interface with broadcasting enabled!";
|
||||||
|
piCoutObj << "initMBcasts ok";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user