⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 server.cpp

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 CPP
字号:

// server.cpp,v 1.5 2003/11/09 20:44:19 dhinton Exp

#include "mmap.h"

#include "ace/Log_Msg.h"
#include "ace/OS_NS_unistd.h"

int
main (int, char *[])
{
        /*
          The default behavior of the memory map wrapper is to create
          the file if it doesn't exist.  This is a minor change from
          the SV shared memory wrapper.
        */
    ACE_Shared_Memory_MM shm_server (SHM_KEY, SHMSZ);
    char *shm = (char *) shm_server.malloc ();
    char *s   = shm;

    ACE_DEBUG ((LM_INFO, "(%P|%t) Memory Mapped file is at 0x%x\n",
                shm ));

    for (char c = 'a'; c <= 'z'; c++)
        *s++ = c;

    *s = '\0';

    while (*shm != '*')
        ACE_OS::sleep (1);

    for (s = shm; *s != '\0'; s++)
    {
        putchar (*s);
    }

    putchar ('\n');

    if (shm_server.remove () < 0)
        ACE_ERROR ((LM_ERROR, "%p\n", "remove"));

    return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -