Skip to content

Instantly share code, notes, and snippets.

View gamenite's full-sized avatar
:shipit:
わが征くは星の大海

Ori gamenite

:shipit:
わが征くは星の大海
  • netease
  • guangzhou
View GitHub Profile
@chenshuo
chenshuo / score_rank.cc
Created March 3, 2012 16:13
Update score and get rank in real time
#include <vector>
#include <assert.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
typedef int32_t Score;
typedef int32_t UserId;
typedef int32_t Rank;
const Score kInvalidScore = -1;
@fxsjy
fxsjy / libevent_multi_worker
Created January 20, 2015 04:25
libevent multithread worker example
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <assert.h>
#include <signal.h>
#include <event2/event.h>
#include <event2/bufferevent.h>
#include <event2/buffer.h>
#include <event2/thread.h>
@darkguy2008
darkguy2008 / UDPSocket.cs
Last active May 20, 2024 19:01
Simple C# UDP server/client in 56 lines
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDP
{
public class UDPSocket
{
private Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);