# Need Help Regarding Socket Programming

**URL:** <https://community.unix.com/t/need-help-regarding-socket-programming/166600>\
**Category:** Programming\
**Created:** [November 5, 2006, 10:58pm UTC](https://community.unix.com/t/need-help-regarding-socket-programming/166600 "2006-11-05T22:58:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![priya.vmr](https://community.unix.com/letter_avatar/priya.vmr/32/6_22734026db12803ebb3e059622ac3534.png) [@priya.vmr](https://community.unix.com/u/priya.vmr)\
**Post date:** [November 5, 2006, 10:58pm UTC](https://community.unix.com/t/need-help-regarding-socket-programming/166600/1 "2006-11-05T22:58:55Z")

</div>

Can anyone plz me. I need a sample code for the following description.  
Its urgent.

It is C/Socket program with the following descriptions:  
NAME  
coreadServer - Concurrent Readers Server.  
coreadClient - Concurrent Readers Client.  
SYNOPSIS  
coreadServer \<OutputFile\>  
coreadClient \<n\> \<InputFile\> \<RemoteHost\> \<Port\>  
DESCRIPTION  
� The coreadClient program creates n children processes communicating with the parent using udp sockets.  
v Each process i, i= 1, 2,.., n do the following:  
Sleeps a random amount of time T, where T \<= n seconds and when it wakes up it:  
� Reads 128 characters from InputFile & terminates if there is no more data to read.  
� Use the udp socket to send the PID followed by the data that have been read.  
v The parent reads from its udp socket and sends the received packets to the coreadServer using its tcp socket.  
� The coreadServer program displays its port number, reads from its tcp socket and produces two files:  
� The OutputFile should be identical to the InputFile and  
� The PIDCounts contains the number of reads performed by each child process.

Example:  
% coreadServer OutputFile  
coreadServer Port#: 61634  
running at host: xx.xx.xx.edu (128.81.4.116 )  
acceped coreadClient connection  
from: 128.82.4.116:61643 (xx.xx.xx.edu)  
% coreadClient 20 InputFile ra 61634  
% cat PIDReport  
4 24408  
5 24392  
5 24398  
5 24403  
5 24411  
6 24397  
6 24401  
6 24405  
6 24415  
6 24417  
7 24396  
7 24407  
7 24409  
7 24414  
8 24393  
8 24394  
8 24406  
8 24416  
9 24399  
10 24395

Thanks in advance

---

<div class="post-metadata">

**Author:** ![blowtorch](https://community.unix.com/user_avatar/community.unix.com/blowtorch/32/136_2.png) [@blowtorch](https://community.unix.com/u/blowtorch)\
**Post date:** [November 6, 2006, 5:22am UTC](https://community.unix.com/t/need-help-regarding-socket-programming/166600/2 "2006-11-06T05:22:28Z")

</div>

Sounds like homework. That's against the rules. Locking the thread.
