Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jun 1998 22:40:20 -0400 (EDT)
From:      Yee Man Chan <ymc@eecs.umich.edu>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   client-server problem  
Message-ID:  <Pine.GSO.3.96.980629221622.1437A-300000@shivam.eecs.umich.edu>

next in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-851401618-899173587=:1437
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.GSO.3.96.980629222834.1442B@shivam.eecs.umich.edu>

Hi,

	I wrote a simple client-server program (attached). What it does
is:

1. Client sends a string of n (n is a parameter) bytes
2. Server receives the string and sends the bytes it received back to the
client.

Usage:
Run server -n 100 in one shell and client -n 100 in the other shell. Then
the n mentioned above will be set to 100. The program assumes both client
and server are on the same machine, so nothing should go to the network.



Here is how the program performs under FreeBSD 3.0-CURRENT with different
n: 
1-100 Very fast
101-207 Very Slow (This range is the strangest I've ever seen)
208-1024 Very fast (just like 1-100)
>1024 strange errors like unknown host or connection timedout

Any clue?

Yee Man

---559023410-851401618-899173587=:1437
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="client.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.3.96.980629224020.1464B@shivam.eecs.umich.edu>
Content-Description: 

I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RkbGliLmg+DQojaW5j
bHVkZSA8dW5pc3RkLmg+DQojaW5jbHVkZSA8bmV0ZGIuaD4NCiNpbmNsdWRl
IDxlcnJuby5oPg0KI2luY2x1ZGUgPHN5cy90aW1lLmg+DQojaW5jbHVkZSA8
c3lzL3R5cGVzLmg+DQojaW5jbHVkZSA8c3lzL3NvY2tldC5oPg0KI2luY2x1
ZGUgPG5ldGluZXQvaW4uaD4NCiNpbmNsdWRlIDxuZXRpbmV0L3RjcC5oP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dl9zZWMgLSB0MS50dl9zZWMpICog
MTAwMDAwMCArDQogICAgICAgICh0Mi50dl91c2VjIC0gdDEudHZfdXNlYyk7
DQp9DQo=
---559023410-851401618-899173587=:1437
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="server.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.3.96.980629224020.1464C@shivam.eecs.umich.edu>
Content-Description: 

I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8ZXJybm8uaD4NCiNpbmNs
dWRlIDxzdHJpbmcuaD4NCiNpbmNsdWRlIDxzaWduYWwuaD4NCiNpbmNsdWRl
IDxmY250bC5oPg0KI2luY2x1ZGUgPGN0eXBlLmg+DQojaW5jbHVkZSA8dW5p
c3RkLmg+DQojaW5jbHVkZSA8bGltaXRzLmg+DQojaW5jbHVkZSA8c3lzL3R5
cGVzLmg+DQojaW5jbHVkZSA8c3lzL3N0YXQuaD4NCiNpbmNsdWRlIDxzeXMv
c29ja2V0Lmg+DQojaW5jbHVkZSA8bmV0aW5ldC9pbi5oPg0KI2luY2x1ZGUg
PGFycGEvaW5ldC5oPg0KI2luY2x1ZGUgPG5ldGRiLmg+DQoNCiNkZWZpbmUg
VElOX1BPUlQgNDg5OA0KDQppbnQgdGluZF9hcmdzKGludCBhcmdjLCBjaGFy
ICphcmd2W10sIGludCAqcG9ydCwgaW50ICogYnl0ZXMpOw0KY2hhciAqIHNl
bGVjdEFORHJlYWQoaW50IHRkLCBjaGFyICpidWYsIGludCBibGVuKTsNCnZv
aWQgdGluZF91c2FnZShjaGFyICpwcm9nbmFtZSk7DQoNCmludCBlcnJubzsN
Cg0KaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKiBhcmd2W10pIHsNCg0KICBp
bnQgcmQsIGNvbm4sIHJldXNlLCBsZW4sIHBvcnQ7DQogIHN0cnVjdCBzb2Nr
YWRkcl9pbiBzZWxmLCBjbGllbnQ7DQogIGNoYXIgYnVmWzIwNDhdOw0KICBp
b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sZWZ0ID4gMCAm
JiBpIDwgMTApOw0KfQ0KICANCnZvaWQNCnRpbmRfdXNhZ2UoY2hhciAqcHJv
Z25hbWUpDQp7DQogIGZwcmludGYoc3RkZXJyLCAiVXNhZ2U6ICVzIC1wIDxw
b3J0bnVtPlxuIiwgcHJvZ25hbWUpOw0KICBleGl0KGVycm5vKTsNCn0NCg0K
LyoNCiAqIHRpbmRfYXJnczogUGFyc2UgYXJncy4NCiAqDQogKiBSZXR1cm4g
MCBvbiBzdWNjZXNzIG9yIGVycm5vIG9uIGZhaWx1cmUuDQogKiBPbiBzdWNj
ZXNzZnVsIHJldHVybiwgInBvcnQiIGNvbnRhaW5zIHRoZQ0KICogcG9ydCMg
dG8gdXNlLCBpbiBob3N0IGJ5dGUgb3JkZXIuDQoqLw0KaW50DQp0aW5kX2Fy
Z3MoaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSwgaW50ICpwb3J0LCBpbnQgKiBi
eXRlcykNCnsNCiAgY2hhciBjOw0KICBleHRlcm4gaW50IG9wdGluZDsNCiAg
ZXh0ZXJuIGNoYXIgKm9wdGFyZzsNCg0KICBlcnJubyA9IDA7DQogICpwb3J0
ID0gVElOX1BPUlQ7DQogIHdoaWxlICgoYyA9IGdldG9wdChhcmdjLCBhcmd2
LCAicDpuOmw6IikpICE9IEVPRikgew0KICAgIHN3aXRjaCAoYykgew0KICAg
IGNhc2UgJ3AnOg0KICAgICAgKnBvcnQgPSBhdG9pKG9wdGFyZyk7DQogICAg
ICBicmVhazsNCiAgICBjYXNlICduJzoNCiAgICAgICpieXRlcyA9IGF0b2ko
b3B0YXJnKTsNCiAgICAgIHJldHVybiAwOw0KICAgIGRlZmF1bHQ6DQogICAg
ICBlcnJubyA9IEVJTlZBTDsNCiAgICAgIGJyZWFrOw0KICAgIH0NCiAgfQ0K
DQogIHJldHVybihlcnJubyk7DQp9DQoNCg==
---559023410-851401618-899173587=:1437--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.3.96.980629221622.1437A-300000>