mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 16:20:03 +02:00
debugging progress and resettting serveraddress at start
This commit is contained in:
parent
38857d6845
commit
2677fe3729
@ -111,11 +111,9 @@ enum communicationProtocol{
|
|||||||
total_sent(0),// sender (client): where to? ip
|
total_sent(0),// sender (client): where to? ip
|
||||||
header_packet_size(0)
|
header_packet_size(0)
|
||||||
{
|
{
|
||||||
//memset(&serverAddress, 0, sizeof(sockaddr_in));
|
memset(&serverAddress, 0, sizeof(serverAddress));
|
||||||
//memset(&clientAddress, 0, sizeof(sockaddr_in));
|
memset(&clientAddress, 0, sizeof(clientAddress));
|
||||||
// serverAddress = {0};
|
// strcpy(hostname,host_ip_or_name);
|
||||||
// clientAddress = {0};
|
|
||||||
// strcpy(hostname,host_ip_or_name);
|
|
||||||
|
|
||||||
strcpy(lastClientIP,"none");
|
strcpy(lastClientIP,"none");
|
||||||
strcpy(thisClientIP,"none1");
|
strcpy(thisClientIP,"none1");
|
||||||
@ -128,8 +126,7 @@ enum communicationProtocol{
|
|||||||
} else {
|
} else {
|
||||||
// Set some fields in the serverAddress structure.
|
// Set some fields in the serverAddress structure.
|
||||||
serverAddress.sin_family = hostInfo->h_addrtype;
|
serverAddress.sin_family = hostInfo->h_addrtype;
|
||||||
memcpy((char *) &serverAddress.sin_addr.s_addr,
|
memcpy((char *) &serverAddress.sin_addr.s_addr, hostInfo->h_addr_list[0], hostInfo->h_length);
|
||||||
hostInfo->h_addr_list[0], hostInfo->h_length);
|
|
||||||
//((char *) &serverAddress.sin_addr.s_addr)[hostInfo->h_length]='\0'; //a fix for valgrind
|
//((char *) &serverAddress.sin_addr.s_addr)[hostInfo->h_length]='\0'; //a fix for valgrind
|
||||||
serverAddress.sin_port = htons(port_number);
|
serverAddress.sin_port = htons(port_number);
|
||||||
socketDescriptor=0; //You can use send and recv, //would it work?????
|
socketDescriptor=0; //You can use send and recv, //would it work?????
|
||||||
@ -179,6 +176,8 @@ enum communicationProtocol{
|
|||||||
header_packet_size(hsize)
|
header_packet_size(hsize)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
memset(&serverAddress, 0, sizeof(serverAddress));
|
||||||
|
memset(&clientAddress, 0, sizeof(clientAddress));
|
||||||
/* // you can specify an IP address: */
|
/* // you can specify an IP address: */
|
||||||
/* // or you can let it automatically select one: */
|
/* // or you can let it automatically select one: */
|
||||||
/* myaddr.sin_addr.s_addr = INADDR_ANY; */
|
/* myaddr.sin_addr.s_addr = INADDR_ANY; */
|
||||||
|
@ -1589,7 +1589,7 @@ int UDPStandardImplementation::createNewFile(int ithread){
|
|||||||
|
|
||||||
printf("\nThread:%d File:%s\n"
|
printf("\nThread:%d File:%s\n"
|
||||||
"Packets Lost:%d"
|
"Packets Lost:%d"
|
||||||
"\t\tTotalpacketsinfile:%lld\tCurrentFrameNumber:%lld\tPreviousFrameNumber:%lld\n",
|
"\t\tPacketsInFile:%lld\tCurrentFrameNumber:%lld\tPreviousFrameNumber:%lld\n",
|
||||||
ithread,completeFileName[ithread],
|
ithread,completeFileName[ithread],
|
||||||
( ((int)(currentFrameNumber[ithread]-frameNumberInPreviousFile[ithread])*packetsPerFrame) - totalPacketsInFile[ithread]),
|
( ((int)(currentFrameNumber[ithread]-frameNumberInPreviousFile[ithread])*packetsPerFrame) - totalPacketsInFile[ithread]),
|
||||||
totalPacketsInFile[ithread],currentFrameNumber[ithread],frameNumberInPreviousFile[ithread]
|
totalPacketsInFile[ithread],currentFrameNumber[ithread],frameNumberInPreviousFile[ithread]
|
||||||
@ -2741,7 +2741,7 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer){
|
|||||||
if(totalWritingPacketCount[ithread]){
|
if(totalWritingPacketCount[ithread]){
|
||||||
printf("\nThread:%d File:%s\n"
|
printf("\nThread:%d File:%s\n"
|
||||||
"Packets Lost:%d"
|
"Packets Lost:%d"
|
||||||
"\t\tTotalpacketsinfile:%lld\tCurrentFrameNumber:%lld\tPreviousFrameNumber:%lld\n",
|
"\t\tPacketsInFile:%lld\tCurrentFrameNumber:%lld\tPreviousFrameNumber:%lld\n",
|
||||||
ithread,completeFileName[ithread],
|
ithread,completeFileName[ithread],
|
||||||
( ((int)(currentFrameNumber[ithread]-frameNumberInPreviousFile[ithread])*packetsPerFrame) - totalPacketsInFile[ithread]),
|
( ((int)(currentFrameNumber[ithread]-frameNumberInPreviousFile[ithread])*packetsPerFrame) - totalPacketsInFile[ithread]),
|
||||||
totalPacketsInFile[ithread],currentFrameNumber[ithread],frameNumberInPreviousFile[ithread]
|
totalPacketsInFile[ithread],currentFrameNumber[ithread],frameNumberInPreviousFile[ithread]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user