由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - 求教!请教client & server program. 感激涕零
相关主题
[转载] Perl calls PL/SQL funtionsemacs中如何去指定一行
why?xhost problem....
how to write robort in perl w/out expect?A question on check out files from VSS NT server to Unix client
[转载] 什么是LWP呢?Re: 如何在Linux/Unix下获取微秒级的进程时间?Any email client to use under cxterm?
关于双面打印请问如何用awk修改文件里的内容?
网络编程如何进行错误处理[转载] 谁能帮我解决这个程序设计问题?
Asking for help on TCP server programming[转载] What does this mean or how does this make sense?
Re: [转载] any ftp client supporting 'scp' under windows?thx能不能推荐几本学习初级 Socket (Server/Client) 的书?谢谢
相关话题的讨论汇总
话题: include话题: client话题: server话题: define话题: program
进入Unix版参与讨论
1 (共1页)
b******r
发帖数: 8
1
不知道为什么client在二次read的时候,返回值会是-1,它应该是0才对。
谢谢。
./server&
./client username
>>hello
/*server program
run as ./server &
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define MAXHOSTNAME 32
#define PORT 1550
#define SPACE " "
void *manage_client (void *argp);
/*
ABOUT ME
++++++++
I am a sample server, who handles messages from only one client.
I read com
a***n
发帖数: 262
2
where is your read in the client?

【在 b******r 的大作中提到】
: 不知道为什么client在二次read的时候,返回值会是-1,它应该是0才对。
: 谢谢。
: ./server&
: ./client username
: >>hello
: /*server program
: run as ./server &
: */
: #include
: #include

b******r
发帖数: 8
3
I reassign the value of t
in while loop of client funtion
by t=int(*argv) every loop,
then it works.
seem t becomes 0 after each loop
why?
I use recv for "read"
Thank

【在 a***n 的大作中提到】
: where is your read in the client?
n******t
发帖数: 4406
4
actually, very simple.
You should not share t among different threads.

【在 b******r 的大作中提到】
: I reassign the value of t
: in while loop of client funtion
: by t=int(*argv) every loop,
: then it works.
: seem t becomes 0 after each loop
: why?
: I use recv for "read"
: Thank

f******k
发帖数: 26
5
oh, netghost, it seems I made the same mistake.

【在 n******t 的大作中提到】
: actually, very simple.
: You should not share t among different threads.

n******t
发帖数: 4406
6
hehe

oh, netghost, it seems I made the same mistake.

【在 f******k 的大作中提到】
: oh, netghost, it seems I made the same mistake.
1 (共1页)
进入Unix版参与讨论
相关主题
能不能推荐几本学习初级 Socket (Server/Client) 的书?谢谢关于双面打印
Re: 能不能推荐几本学习初级 Socket (Server/Client) 的书?谢谢网络编程如何进行错误处理
reinstall nis clientAsking for help on TCP server programming
multicaste programming helpRe: [转载] any ftp client supporting 'scp' under windows?thx
[转载] Perl calls PL/SQL funtionsemacs中如何去指定一行
why?xhost problem....
how to write robort in perl w/out expect?A question on check out files from VSS NT server to Unix client
[转载] 什么是LWP呢?Re: 如何在Linux/Unix下获取微秒级的进程时间?Any email client to use under cxterm?
相关话题的讨论汇总
话题: include话题: client话题: server话题: define话题: program