# help regarding socket programming

**URL:** <https://community.unix.com/t/help-regarding-socket-programming/198638>\
**Category:** Programming\
**Created:** [May 27, 2008, 12:29pm UTC](https://community.unix.com/t/help-regarding-socket-programming/198638 "2008-05-27T12:29:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abmxla007](https://community.unix.com/letter_avatar/abmxla007/32/6_22734026db12803ebb3e059622ac3534.png) [@abmxla007](https://community.unix.com/u/abmxla007)\
**Post date:** [May 27, 2008, 12:29pm UTC](https://community.unix.com/t/help-regarding-socket-programming/198638/1 "2008-05-27T12:29:25Z")

</div>

i m using sockets for setting up a connection between a server and a client.  
When the clients gets connected to the server, its ip is conveyed to the server through one of the predefined structures in c library...  
i save this ip address in an array....1st client's ip address goes to the zeroth element....2nd client's ip addr goes to the 1st element and so on....

the problem is that when 2nd client connects to the server, it overwrites the previously saved ip addresses,i.e. the zeroth element now saves ip addr of 2nd client....

can anyone tell me a way to get out of this situation???  
thnx in advance...🙂

---

<div class="post-metadata">

**Author:** ![gautamdheeraj](https://community.unix.com/letter_avatar/gautamdheeraj/32/6_22734026db12803ebb3e059622ac3534.png) [@gautamdheeraj](https://community.unix.com/u/gautamdheeraj)\
**Post date:** [May 28, 2008, 2:17am UTC](https://community.unix.com/t/help-regarding-socket-programming/198638/2 "2008-05-28T02:17:47Z")

</div>

Please post your code snippet of server. This way we won't be able to help you much.

- Dheeraj
