UDP over unix domain socket

Javor Dimitrov (logix@dobrich-sat.net)
Tue, 18 Sep 2001 12:05:05 +0300 (EEST)


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.

--1221861848-575233476-1000803905=:10719
Content-Type: TEXT/PLAIN; charset=US-ASCII

the attached files are client and server. they simply have to send a
string each other in UDP packets via unix domain socket. i'm wondered,
because every time when the server receives a string with recvfrom(),
'*fromlen' is 2 and 'from' points to some unknown structure.
i am using slackware linux with kernel 2.2.19

--1221861848-575233476-1000803905=:10719
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="unixudpcli.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.20.0109181205050.10719@dobrich-sat.net>
Content-Description:
Content-Disposition: attachment; filename="unixudpcli.c"

I2luY2x1ZGUgPHN5cy9zb2NrZXQuaD4NCiNpbmNsdWRlIDxzeXMvdW4uaD4N
CiNpbmNsdWRlIDx1bmlzdGQuaD4NCiNpbmNsdWRlIDxzdHJpbmcuaD4NCg0K
I2RlZmluZSAgU09DS1BBVEgJImxvY2Fsc29ja2V0Ig0KDQp2b2lkIGVycl9z
eXMoIGNvbnN0IGNoYXIgKiBjb25zdCApOw0KDQoNCg0KaW50IG1haW4oKQ0K
ew0KICBzdHJ1Y3Qgc29ja2FkZHJfdW4gICB1YWRkciwgY2FkZHI7DQogIGlu
dCAgICAgICAgICAgICAgICAgIHVzb2NrLCByZXM7DQogIGNoYXIgICAgICAg
ICAgICAgICAgIGJ1ZmZlclszMl0gPSAiIjsNCiAgc29ja2xlbl90ICAgICAg
ICAgICAgbGVuOw0KDQogIG1lbXNldCggJnVhZGRyLCAwLCBzaXplb2YodWFk
ZHIpICk7DQogIHVhZGRyLnN1bl9mYW1pbHkgPSBBRl9MT0NBTDsNCiAgc3Ry
Y3B5KCB1YWRkci5zdW5fcGF0aCwgU09DS1BBVEggKTsNCg0KICBpZiggKCB1
c29jayA9IHNvY2tldCggUEZfTE9DQUwsIFNPQ0tfREdSQU0sIDAgKSApID09
IC0xICkNCiAgICBlcnJfc3lzKCAic29ja2V0KCkiICk7DQogIHByaW50Zigg
IlVzZXIgRGF0YWdyYW0gU29ja2V0ICVkXG4iLCB1c29jayApOw0KDQogIHBy
aW50ZiggInVhZGRyIHNvY2thZGRyX3VuIGhhcyAlZCBieXRlc1xuIiwgKGxl
bj1TVU5fTEVOKCZ1YWRkcikpICk7DQogIGlmKCBzZW5kdG8oIHVzb2NrLCAi
SGFpbCIsIDQsIDAsIChzdHJ1Y3Qgc29ja2FkZHIqKSZ1YWRkciwgbGVuICkg
PT0gLTEgKQ0KICAgIGVycl9zeXMoICJzZW5kdG8oKSIgKTsNCg0KICBwcmlu
dGYoICJjYWRkciBzb2NrYWRkcl91biBoYXMgJWQgYnl0ZXNcbiIsIChsZW49
U1VOX0xFTigmY2FkZHIpKSApOw0KICBpZiggcmVjdmZyb20oIHVzb2NrLCBi
dWZmZXIsIHNpemVvZihidWZmZXIpLCAwLA0KICAgIChzdHJ1Y3Qgc29ja2Fk
ZHIqKSZjYWRkciwgJmxlbiApID09IC0xICkNCiAgICBlcnJfc3lzKCAicmVj
dmZyb20oKSIgKTsNCg0KICBwcmludGYoICJSZWNlaXZlZCAlZCBieXRlc1xu
IiwgcmVzICk7DQogIHByaW50ZiggIkJ1ZmZlciBub3cgaXMgXCIlc1wiXG4i
LCBidWZmZXIgKTsNCn0NCg0KDQoNCnZvaWQgZXJyX3N5cyggY29uc3QgY2hh
ciAqIGNvbnN0IG1lc2cgKQ0Kew0KICBwZXJyb3IoIG1lc2cgKTsNCiAgZXhp
dCggLTEgKTsNCn0=
--1221861848-575233476-1000803905=:10719
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="unixudpsvr.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.20.0109181205051.10719@dobrich-sat.net>
Content-Description:
Content-Disposition: attachment; filename="unixudpsvr.c"

I2luY2x1ZGUgPHN5c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IHVsZW4gKTsNCiAgICByZXMgPSByZWN2ZnJvbSggdXNv
Y2ssIGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZlciksIDAsDQogICAgICAoc3RydWN0
IHNvY2thZGRyKikmY2FkZHIsICZ1bGVuICk7DQogICAgaWYoIHJlcyA9PSAt
MSApDQogICAgICBlcnJfc3lzKCAicmVjdmZyb20oKSIgKTsNCg0KICAgIGJ1
ZmZlcltyZXNdID0gJ1wwJzsNCiAgICBwcmludGYoICJSZWNlaXZlZCAlZCBi
eXRlc1xuIiwgcmVzICk7DQogICAgcHJpbnRmKCAiUmVtb3RlIHN0cnVjdHVy
ZSBoYXMgJWQgYnl0ZXNcbiIsIHVsZW4gKTsNCi8qICAgICAgKHVuc2lnbmVk
KShodG9ucygqKChzaG9ydCopY2FkZHIuc3VuX3BhdGgpKSkgKTsgKi8NCg0K
ICAgIHJlcyA9IHNlbmR0byggdXNvY2ssICJIZWxsb1xyXG4iLCA3LCAwLA0K
ICAgICAgKHN0cnVjdCBzb2NrYWRkciopJmNhZGRyLCB1bGVuICk7DQogICAg
aWYoIHJlcyA9PSAtMSApDQogICAgICBlcnJfc3lzKCAic2VuZHRvKCkiICk7
DQogICAgfQ0KfQ0KDQoNCg0Kdm9pZCBlcnJfc3lzKCBjb25zdCBjaGFyICog
Y29uc3QgbWVzZyApDQp7DQogIHBlcnJvciggbWVzZyApOw0KICBleGl0KCAt
MSApOw0KfQ==
--1221861848-575233476-1000803905=:10719--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/