91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 0.33M
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2024-01-03
  • 語言: 其他
  • 標簽: 其他??

資源簡介

a87367f4a675f35a12528fbaf99f3130.zip

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?

#define?HOSTLEN 256
#define ROWS 23
#define COLS 80

int?sock;

int?connect_to_server(char?*host?int?portnum){
int?sock;
struct?sockaddr_in?servadd;?/*?the?number?to?call?*/
struct?hostent?*hp;?/*?used?to?get?number?*/
/**?Step?1:?Get?a?socket?**/
sock?=?socket(AF_INET?SOCK_STREAM?0);?/*?get?a?line?*/
if(sock?==?-1)
return?-1;
/**?Step?2:?connect?to?server?**/
bzero(&servadd?sizeof(servadd));?/*?zero?the?address?*/
hp?=?gethostbyname(host);?/*?lookup?host‘s?ip?#?*/
if?(hp?==?NULL)
return?-1;
bcopy(hp->h_addr?(struct?sockaddr?*)&servadd.sin_addr?hp->h_length);
servadd.sin_port?=?htons(portnum);?/*?fill?in?port?number?*/
servadd.sin_family?=?AF_INET?;?/*?fill?in?socket?type?*/
if?(connect(sock(struct?sockaddr?*)&servadd?sizeof(servadd))?!=?0)
return?-1;
return?sock;
}
void?*send_oper(void?*args){
char?oper[1];
while(1){
oper[0]?=?getch();
write(sock?oper?1);
}
}

main(int?ac?char?*av[]){
char?*cell;
sprintf(cell?“%s“?av[3]);
if?(ac? fprintf(stderr“usage:?Missing?parameters!\n“);
exit(1);
}
if(cell[0]?==?‘o‘){
printf(“The?cell?can‘t?be?\“o\“!\n“);
exit(1);
}
sock?=?connect_to_server(av[1]?atoi(av[2]));
if(sock?==?-1){
printf(“Connected?failed!\n“);
exit(1);
}

write(sock?av[3]?1);
initscr();
crmode();
noecho();
clear();
curs_set(0);
if(start_color()?==?OK){
init_pair(1COLOR_REDCOLOR_BLACK);
attron(COLOR_PAIR(1));
}
pthread_t?thread;
pthread_create(&thread?NULL?send_oper?NULL);

char?screen[ROWS*COLS];
int?i;
int?n;
int?index;
while(1){
n?=?read(sock?&screen[index]?ROWS*COLS-index);
index?+=?n;
if(index?==?ROWS*COLS){

move(00);
for(i=0;i addch(screen[i]);
}
refresh();
index=0;
}
}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????347598??2020-01-10?10:16??東北大學Linux大作業——貪吃蛇多人聯機游戲\Linux?操作系統期末大作業.docx
?????文件????????2008??2020-01-10?09:30??東北大學Linux大作業——貪吃蛇多人聯機游戲\client.c
?????文件????????8731??2020-01-10?09:04??東北大學Linux大作業——貪吃蛇多人聯機游戲\server.c
?????目錄???????????0??2020-02-04?11:49??東北大學Linux大作業——貪吃蛇多人聯機游戲\

評論

共有 條評論