#include #include #include #include #include #include #include #include #define port 25341
#define backlog 5
#define mem_size 1024
struct event_base* base;
struct sock_ev ;
void release_sock_event(struct sock_ev* ev)
void on_write(int sock, short event, void* arg)
void on_read(int sock, short event, void* arg)
event_set(ev->write_ev, sock, ev_write, on_write, ev->buffer);
event_base_set(base, ev->write_ev);
event_add(ev->write_ev, null);
}void on_accept(int sock, short event, void* arg)
int main(int argc, char* argv)
LIBEVENT應用舉例1
include include include include include include include include include void sock read int fd,short event,void arg int len struct event ev struct even...
棧的應用舉例2(迷宮求解)
func3 1.cpp algo3 5.cpp algo3 9.cpp和algo3 11.cpp要呼叫的函式 結構和全域性變數 struct postype 迷宮座標位置型別 見圖3.9 define maxlength 25 設迷宮的最大行列為25 typedef int mazetype max...
Parcelable 應用舉例
首先,自定義物件必須實現parcelable,並且建立static final parcelable.creatorcreator物件 實現createfromparcel和newarray方法 自定義物件為 public static class contact implements parcel...