SKYENGINE API  参考手册返回目录  

 

int32 mr_sendto(int32 s, const char *buf, int len, int32 ip, uint16 port)



Description
发送数据报。
Parameters

Name Description
s socket句柄
buf 待发送数据buffer
len 待发送数据字节数
ip 对端IP
port 对端端口

Return Value

>=0                              实际发送的字节数
MR_FAILED                     出错

Remarks

 

Example

/*mrp code*/

#define SOCKET_SENDBUFFER_SIZE 2048
const char sSendBuffer[SOCKET_SENDBUFFER_SIZE ];

mrc_sendto( hSoc,  sSendBuffer, SOCKET_SENDBUFFER_SIZE, (int32*)&ip, (uint16*)&port ); /*hSoc为mr_socket创建的句柄,ip为对端的IP地址,port为对端的端口号。*/

See Also
 


Copyright ?2005-20010 SKY-MOBI

返回目录