Originally posted by: BaoKhanh
please send me source code audio streaming client/server
thank!
Originally posted by: Mouse
i finally got this method to work, here's a tip.. If you are sure there is going to be only one instance of the server, you could use ::OpenEvent() in the client instead of ::CreateEvent(). If the server has not called ::CreateEvent(), ::OpenEvent() (in the client process) will return NULL letting you know that the server is not there or has not created the events yet. If you call ::CreateEvent() in the client, it will create the event dispite what is going on with the server.
-mouse
Originally posted by: Mouse
exactly what i needed.
excellent job on describing how this works.
Originally posted by: yaron
I read the program that you wrote and I want to transfer data by mailslot -its seems to be simpler.
anyway when i`m using the mail slot in a server and tries to connect it from a pipe i get access denied... when it was in a normal application it worked fine.
Originally posted by: Chen
Hi:
I use the same method for IPC on NT 4.0 SP 4, VC++6.0
I have built two applications, one running as NT service. the other running as a normal Windows application for monitoring the service.
I follow same procedure in both applications. First calling CreateFileMapping() followed by MapViewOfFile(). The problem is if I run NT service first, then run the Windows application, I get a failure saying ERROR_ACCESS_DENIED (05). But this problem doesn't occure if I swap the running order.
The snapshot is provided.
In NT service:
bool CMyService::CreateSharedMem()
{
m_hMap =::CreateFileMapping((HANDLE)0xffffffff,
0,
PAGE_READWRITE,
0,
0x100000,
"mysharedmem");
if(m_hMap == NULL)
return false;
m_pSharedData =::MapViewOfFile(m_hMap,
FILE_MAP_WRITE,
0,
0,
0);
if(m_pSharedData == NULL)
return false;
return true;
}
In monitoring Win application.
bool CSpconsoleApp::CreateSharedMem()
{
m_hMap =::CreateFileMapping((HANDLE)0xffffffff, //or can be an open file handle
0,
PAGE_READWRITE,
0,
0x100000,
"mysharedmem");
if(m_hMap == NULL)
return false;
m_pSharedData =::MapViewOfFile(m_hMap,
FILE_MAP_WRITE,
0,
0,
0);
if(m_pSharedData == NULL)
{
//Get ERROR_ACCESS_DENIED here
int error = GetLastError();
return false;
}
sharedMemAllocated = true;
return true;
}
There is no sync. done in the 2 applications. But if that's the culprit, the problem shall happen regardless of the running order. And VC++ document says if file-mapping object already exist, then CreateFileMapping() is equal to OpenFileMapping().
What could be the reason? Thank you in advance.
Originally posted by: M. Patil
I have a program working using shared memory techniq. I need to run more than one instance of server and client. How can I change name of shared memory handle(If first instance is running) for second instance?. Any help is appreciated.
Thanks
ReplyOriginally posted by: Rikhi Daman
I have gone through your documentation and I feel that it is no doubt an excellent work in this field.
I wanted to modify this code saying that the client first searches it's local drive say 'c:/' to find the specific file he/she looking for. If the file is not found then he/she searches it in intranet assuming that the client is connected to intranet. If the file is found then it's served to the client else then the client request the remote server for the specif file (movie) of any format say avi or MPEG. If the file is found then it's served to the client else the client specify the URL address from where to download the movie. The server goes to that perticular cite and download the movie into its memory and then accept the request from client....
I hope it sound good but need lot of hard work. So I request you if you can help me giving me with some pointers where I can find the sample code on the implementation of client server technology.
Thanks...
Rikhi Daman
Hi!!
Originally posted by: James
Try this shared memory class posted on MSJ.
http://www.microsoft.com/MSJ/1198/wicked/wicked1198top.htm
ReplyOriginally posted by: James
Dear,
Thank you for your information about IPC.
I'd like to implement IPC using VC++(ver:6.0). Is it possible to open the source?. Please send it to my E-mail.
Finally, I've worked for Hotel in Korea. I hope that I'll help another programmer about it.
Thank you again.
Sincerely,
James,
Originally posted by: Arun Kumar S
It's very convinient method ... sharing the memory in clint and server.
The explanation is very impressive. But, In My case, as beginner...
could You please provide a full sample program for the same.
Please, Open your code or send your code to my e-mail.
Keep up the good work
Arun
Reply