Sockets.cpp: Fix initialization of UDD socket
Without this line, destination address for a UDD socket is left with incorrect value AF_UNSPEC. Later on when calling DatagramSocket:write(), sendto() fails with EINVAL. This commit fixes test SocketsTest.cpp. Change-Id: I6e1b7e743a781abdcf69aa9842b30be893633433
This commit is contained in:
parent
a3694bd303
commit
2edbe4d366
|
@ -324,6 +324,7 @@ void UDDSocket::open(const char* localPath)
|
|||
void UDDSocket::destination(const char* remotePath)
|
||||
{
|
||||
struct sockaddr_un* unAddr = (struct sockaddr_un*)mDestination;
|
||||
unAddr->sun_family = AF_UNIX;
|
||||
strcpy(unAddr->sun_path,remotePath);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue