Linux下C++类的线程函数
最近在用C++编写一个RTSP的客户端,由于要用到线程,根据C编程的经验,写了如下代码:
class LiRtspSession
{
public:
void* MainThreadFunc(void* pvData);
void* AudioProcThreadFunc(void* pvData);
void Connect();
//省略的代码
private:
pthread_t m_hProcHandle, m_hAudioProcHandle;
//省略的代码
};
void LiRtspSession::Connect()
{
//create main thread creating rtsp session and receiving rtp/rtcp packet
int ret = pthread_create(&m_hProcHandle, NULL, MainThreadFunc, this);
if(ret != 0)
{
return;
}
//create a thread receiving audio data
if(m_bAudioEnabled && m_eProtoType == ptUDP);
{
ret = pthread_create(&m_hAudioProcHandle, NULL, AudioProcThreadFunc, this);
if(ret != 0)
{
return;
}
}
pthread_join(m_hProcHandle, NULL);
if(m_bAudioEnabled && m_eProtoType == ptUDP);
{
pthread_join(m_hAudioProcHandle, NULL);
}
}
但是在编译时却出现如下错误:
LiRtspSession.cpp: In member function ‘void LiRtspSession::Connect()’:
LiRtspSession.cpp:176: error: argume
相关文档:
Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......
环境说明:本机只有一张网卡,使用静态IP上网
命令:apt-get install shorewall ubuntu会自动的给你安装好,但是shorewall没有配置
也没有启动
「1」首先cp /usr/share/doc/shorewall/examples/one-interface/* /etc/shorewall
「2」修改/etc/shorewall/shor ......
一、LINUX下关于文件权限的表示方法和解析
LINUX下可以用ls -l 命令来看到文件的权限。用ls命令所得到的表示法的格式是类似这样的:-rwxr-xr-x 。下面解析一下格式所表示的意思。这种表示方法一共有十位:
9 8 7 6 5 4 3 2 1 0
- r w x r - x r - x
第9位表示文件类型,可以为p、d、l、s、c ......
linux目录架构
/ 根目录
/bin 常用的命令
binary file 的目錄
/boot 存放系统启动时必须读取的档案,包括核心
(kernel) 在内
/boot/grub/menu.lst GRUB设置
/boot/vmlinuz 内核
......
先写几条,自己常用的,以后再补充:
1. ALT + '.'
前一条命令的最后一个参数。
例如:
第一条命令,ls /usr/loca/;
第二条命令,cd /usr/local;
第二条命令的/usr/local,直接通过ALT+'.'即可输入。
2.CTRL+'r'
在history中寻找命令
3.TAB
补齐文件名或目录名
4.$ find -name '*.[ch]' | xargs grep -E 'expr' ......