9.10.2011 - stable backup commit
This commit is contained in:
@@ -50,7 +50,7 @@ void PIEthernet::terminate() {
|
||||
if (!receiverInitialized()) return;
|
||||
if (isRunning()) {
|
||||
stop();
|
||||
pthread_cancel(thread);
|
||||
PIThread::terminate();
|
||||
}
|
||||
tries = 0;
|
||||
/*if (sock != -1) {
|
||||
@@ -74,7 +74,7 @@ void PIEthernet::begin() {
|
||||
|
||||
void PIEthernet::run() {
|
||||
#ifdef WINDOWS
|
||||
int addr_len = sizeof(sockaddr_storage);
|
||||
int addr_len = sizeof(sockaddr);
|
||||
#else
|
||||
socklen_t addr_len = sizeof(sockaddr_storage);
|
||||
#endif
|
||||
@@ -107,6 +107,7 @@ bool PIEthernet::init() {
|
||||
#endif
|
||||
sock = socket(PF_INET, SOCK_DGRAM, 0);
|
||||
if (bind(sock, (sockaddr * )&addr_, sizeof(addr_)) == -1) {
|
||||
tries++;
|
||||
if (tries < 10) {
|
||||
if (init()) {
|
||||
tries = 0;
|
||||
@@ -128,6 +129,7 @@ bool PIEthernet::initSend() {
|
||||
#endif
|
||||
sock_s = socket(PF_INET, SOCK_DGRAM, 0);
|
||||
if (sock_s == -1) {
|
||||
tries++;
|
||||
if (tries < 10) {
|
||||
if (init()) {
|
||||
tries = 0;
|
||||
|
||||
Reference in New Issue
Block a user