<div>So I went through the trouble of creating test code for this aspect and it came out clean. So I guess there&#39;s something else getting messed up along the way.</div>
<div>Rick<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 9/22/07, <b class="gmail_sendername">Richard Schmidt</b> &lt;<a href="mailto:huntingtonsurfca@gmail.com">huntingtonsurfca@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>The sockaddr_in struct doesn&#39;t like to be modified via a pointer.</div>
<div>&nbsp;</div>
<div>I&#39;m trying to modularize my code but this is preventing me from doing so.</div>
<div>&nbsp;</div>
<div>prototype: char *clientParse(char*buff, struct sockaddr_in *serv, ...)</div>
<div>and calling it: sBuff = clientParse(inBuff, &amp;serv_addr, &amp;my_addr);</div>
<div>&nbsp;</div>
<div>I dereference the pointer in the function like this:</div>
<div>&nbsp;</div>
<div>serv-&gt;sin_family = AF_INET;</div>
<div>&nbsp;</div>
<div>But when I try to bind the connection, using the serv_addr (in main), it fails.</div>
<div>&nbsp;</div>
<div>So I tried making local variables (in the function) and then:</div>
<div>&nbsp;</div>
<div>memcpy(serv, &amp;servAddr, sizeof(struct sockaddr_in)); (in function)</div>
<div>&nbsp;</div>
<div>but this is still failing. Anyone else have an idea? I know this is the reason why it is failing because I&#39;ve had this problem before with it and I found a workaround using memcpy() but that was in the same scope. I guess that&#39;s why it didn&#39;t work across function calls. 
</div>
<div>&nbsp;</div>
<div>Any ideas?</div>
<div>Rick</div></blockquote></div><br>