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