Skip to content

Commit dac7bd9

Browse files
Adding Support of Nonblocking socket
Adding support for Nonblocking socket so, pldm will not blocked during data transfer between host and BMC. in previous case pldm was blocked if DMA transfer blocked in middle of operation. Signed-off-by: Kamalkumar Patel <[email protected]>
1 parent 1832f37 commit dac7bd9

22 files changed

+993
-712
lines changed

common/utils.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ struct CustomFD
5656
CustomFD(CustomFD&&) = delete;
5757
CustomFD& operator=(CustomFD&&) = delete;
5858

59-
CustomFD(int fd) : fd(fd)
59+
CustomFD(int fd, bool closeOnOutScope = true) :
60+
fd(fd), closeOnOutScope(closeOnOutScope)
6061
{}
6162

6263
~CustomFD()
6364
{
64-
if (fd >= 0)
65+
if (fd >= 0 && closeOnOutScope)
6566
{
6667
close(fd);
6768
}
@@ -74,6 +75,7 @@ struct CustomFD
7475

7576
private:
7677
int fd = -1;
78+
bool closeOnOutScope = true;
7779
};
7880

7981
/** @brief Calculate the pad for PLDM data

0 commit comments

Comments
 (0)