|
Use this class[^]
- Michael Haephrati מיכאל האפרתי
|
|
|
|
|
Many thanks. I'll give it a try.
|
|
|
|
|
I'm studying MMS Protocol in order to develop the program connecting to FM Radio broadcast of which the url scheme is mms://domain_name/sub_name(directory name?) such as mms://wmc1.liquidviewer.net/WEEI
I can obtain the ip address of mms url above, but i don't know the meaning of sub_name. it's important when i write tcp socket code.
The socket function usually takes ip address and port number.
The MMS protocol's port number is used with 1755.
If i have ip address and port number, i can write code as below.
-------------------------------------------------------------
const int MMF_PROTOCOL = 1755;
char sServerIP[] = "127.0.0.1";
if(WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
ErrorHandling("WSAStartup() error!");
hSocket=socket(PF_INET, SOCK_STREAM, 0);
if(hSocket == INVALID_SOCKET)
ErrorHandling("socket() error");
memset(&servAddr, 0, sizeof(servAddr));
servAddr.sin_family=AF_INET;
servAddr.sin_addr.s_addr=inet_addr(sServerIP);
servAddr.sin_port=htons(MMF_PROTOCOL);
if(connect(hSocket, (struct sockaddr*)&servAddr, sizeof(servAddr))==SOCKET_ERROR)
ErrorHandling("connect() error!");
while(1)
{
send(hSocket, message, strlen(message), 0);
...
}
-------------------------------------------------------------
However, i don't know how to connect that mms url owing to the sub_name(directory?).
if mms url is mms://111.222.333.444, i can try to connect server with socket because in that case i know ip address and port number(MMS Protocol's port number, 1755).
But, with mms://111.222.333.444/sub_name(directory?), i can't connect due to sub_name.
I want to take account of sub_name, then do my purpose.
Do you know anybody about this problem?
|
|
|
|
|
|
Thank you for your answer.
Should i study RTSP for that work?
hm... anyway, your answer is very helpful and will be helpful.
However, I am still wondering how to connect to mms url such as "mms://wmc1.liquidviewer.net/WEEI" when programming socket.
The below is extracted on the URL you mentioned.
"As of 2012 Microsoft still recommends[1] using "mms://" as a "protocol rollover[2] URL"."
Therefore, whether or not i use RTSP, i have to know the way to connect mms url with socket for my work.
In this part, do you have any answer?
thank you for your interest.
|
|
|
|
|
|
sure.
I already saw that document and downloaded "[MS-MMSP].pdf" for reading.
Then I read it roughly.
Could you tell me about what i may be missing.
|
|
|
|
|
Sorry, you need to find the references in the document.
|
|
|
|
|
ok, thank you for your attention.
|
|
|
|
|
Dear all:
I use enumdisplaysetting api to get the display orientation.
It return different value of the dmDisplayOrientation of DEVMODE structure in the same degree but different graphic.
For example:
If I rotate the screen in 90 degrees counterclockwise, the api
may return 1 with ati graphic, but 3 with nvidia graphic.
How to get same result in the same degree with different graphic? Or other method?
Best regards, Victor
|
|
|
|
|
1=DMDO_90 and 3=DMDO_270 (from here[^])... why not just check for either condition? when it comes to displays, that's the same thing.
|
|
|
|
|
Dear Holguin:
I must be knowing the display orientation, so that I can process the absolute coordinate to windows desktop.
The Enumdisplaysetting api returns display orientation with different graphic in xp, but same result in win 7.
Does anyelse method to judge the display orientation?(same degree, different graphic, but same result)
best regards, Victor
|
|
|
|
|
cedricvictor wrote: so that I can process the absolute coordinate to windows desktop
This shouldn't matter because coordinates in Windows are always with zero,zero being in the top, left corner of the screen. Whether a screen is rotated 90 degrees to one side, or 270 to the other, you get the same origin reference point (top,left).
|
|
|
|
|
While true, the documentation states "measured clockwise". Provided the user has turned the monitor the same direction using both vendor's drivers, one of them is clearly wrong.
Does WHQL still exist? If so, perhaps Microsoft would like a ping "Hey, you don't check this!".
|
|
|
|
|

modified 2-Jan-15 9:16am.
|
|
|
|
|
Are you and Scholar247 the same person? If so please request removal of one profile.
As to your questions:
- This site does not provide code to order. Google is the place for samples.
- The consequences of a race condition may vary from incorrect results, to a program not responding.
- There are many different situations when this may be appropriate, but it depends on the problem to be solved.
- Impossible to answer as any problem's ease of resolution depends on a lot of factors.
|
|
|
|
|
int g_x = 0;
DWORD WINAPI Add(void* p) //p unused parameter
{
g_x++;
}
void main()
{
HANDLE m_hArr[10];
int i = 0;
for( ; i < 10; i++ )
{
CreateThread( NULL,0,Add,NULL,0,&m_hArr[i]);
}
//Wait for all the 10 threads to complete its execution
::WaitForMultipleObjects(10,m_hArr,TRUE,INDEFENITE);
//Now print the result.You expect 10 but it may not be...
cout<<"g_x = "<
|
|
|
|
|
Because the order of the execution.
Suppose you have 4 floats a,b,c,d
and you want to sum up them.
In case of serial implementation, it will be like a + b + c + d
But in case of parallel, it may execute like
(a+b) + (c+d)
So the result wont be same.
This answers your 4th question.
|
|
|
|
|
2. Consequence of race condition:
Your resource will go to a corrupted state.
Not getting the expected result etc.,
|
|
|
|
|
:
modified 2-Jan-15 9:24am.
|
|
|
|
|
Your question is not clear. What is the connection between mult-threading and rounding errors?
|
|
|
|
|
Richard MacCutchan wrote: What is the connection between mult-threading and rounding errors?
His homework question?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thanks, I'm not an expert in rounding, but I will stand a round (or around).
|
|
|
|
|
Overheard many years ago that "C is strongly typed language".
So what's up with unspecified / unknown "standard definition " of int abs (int) overloaded by , again unknown source "standard", to <b>float abs ( float)</b>?
Is it just "progress" AKA from plain C to C "whatever is latest derivative of it" or just plain lack of real standards ?
Happy coding in 2015
Cheers Vaclav
|
|
|
|
|