Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@myourys
myourys / CSocket.cpp
Created October 29, 2013 12:54
相信很多人都找,但网上给出的答案又觉得看不懂。其实就是使用bsd socket.但这个只能在linux下面使用,而在window是无法使用的。所以我们要封装一下。
#ifndef __CSocket__
#define __CSocket__
#if CC_TARGET_PLATFORM==CC_PLATFORM_WIN32
#include <winsock.h>
#elif CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
@myourys
myourys / odsocket.cpp
Last active December 26, 2015 14:28
跨平台Socket封装,只是简单的把两个类库糅合在一起,主要是为了自己用到的时候可以方便的调用。
/*
* define file about portable socket class.
* description:this sock is suit both windows and linux
* design:odison
* e-mail:odison@126.com>
*
*/
#ifndef _ODSOCKET_H_
#define _ODSOCKET_H_
#!/bin/bash
#=============================================================================
# FileName: vps-backup.sh
# Desc: vps backup script
# Author: Hector
# Email: myourys@gmail.com
# HomePage: http://www.yiwuye.com
# Version: 0.0.1
# LastChange: 2014-07-17 14:50:13
# History: