mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Add LiGetPortFlagsFromTerminationErrorCode()
This commit is contained in:
parent
6010367637
commit
453c722fa8
@ -27,6 +27,20 @@ unsigned int LiGetPortFlagsFromStage(int stage)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int LiGetPortFlagsFromTerminationErrorCode(int errorCode)
|
||||||
|
{
|
||||||
|
switch (errorCode)
|
||||||
|
{
|
||||||
|
case ML_ERROR_NO_VIDEO_TRAFFIC:
|
||||||
|
// Video is UDP 47998, but we'll also test UDP 48000 because
|
||||||
|
// we don't have an equivalent audio traffic error.
|
||||||
|
return ML_PORT_FLAG_UDP_47998 | ML_PORT_FLAG_UDP_48000;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int LiGetProtocolFromPortFlagIndex(int portFlagIndex)
|
int LiGetProtocolFromPortFlagIndex(int portFlagIndex)
|
||||||
{
|
{
|
||||||
// The lower byte is reserved for TCP
|
// The lower byte is reserved for TCP
|
||||||
|
@ -555,10 +555,13 @@ int LiGetPendingAudioDuration(void);
|
|||||||
#define ML_PORT_FLAG_UDP_48000 0x0400
|
#define ML_PORT_FLAG_UDP_48000 0x0400
|
||||||
#define ML_PORT_FLAG_UDP_48010 0x0800
|
#define ML_PORT_FLAG_UDP_48010 0x0800
|
||||||
|
|
||||||
// Returns the port flags that correspond to ports involved in a failing connection stage.
|
// Returns the port flags that correspond to ports involved in a failing connection stage, or
|
||||||
// This may be used to specifically test the ports that could have caused the connection failure.
|
// connection termination error.
|
||||||
// If no ports are likely involved with a given stage failure, this function returns 0.
|
//
|
||||||
|
// These may be used to specifically test the ports that could have caused the connection failure.
|
||||||
|
// If no ports are likely involved with a given failure, this function returns 0.
|
||||||
unsigned int LiGetPortFlagsFromStage(int stage);
|
unsigned int LiGetPortFlagsFromStage(int stage);
|
||||||
|
unsigned int LiGetPortFlagsFromTerminationErrorCode(int errorCode);
|
||||||
|
|
||||||
// Returns the IPPROTO_* value for the specified port index
|
// Returns the IPPROTO_* value for the specified port index
|
||||||
int LiGetProtocolFromPortFlagIndex(int portFlagIndex);
|
int LiGetProtocolFromPortFlagIndex(int portFlagIndex);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user