write()'s to network stream are sent but not received 
Author Message
 write()'s to network stream are sent but not received

Hi folks,

  I'm having trouble getting a network connection setup in a program.  This
is my first attempt at doing this manually.  In the past, I've used
pre-packaged functions written by someone else.

  Here's essentially what I've done (checking return val's along the way):

sock = socket(AF_INET,SOCK_STREAM,0);
connect(sock,dest,sizeof(dest));
write(sock,data,length);

  Now, after the connect call, THERE IS a connection.  I can verify
this on both machines.  (e.g. If I connect to the FTP server on a
machine, I can go to that machine and see the connection).  And netstat -a
on the both machines show the connection as esablished.

  Problem is, the write's, while returning positive values, don't appear
to work.  At least the remote system isn't receiving data.

  Like I said, this is my first time doing this directly, so if I'm missing
something obvious, I'd appreciate any pointers.

  I couldn't find any good primer's on this anywhere.

Thanks,
Cengiz



Sat, 06 Jan 2001 03:00:00 GMT  
 write()'s to network stream are sent but not received

Quote:

>   I'm having trouble getting a network connection setup in a program.  This
> is my first attempt at doing this manually.  In the past, I've used
> pre-packaged functions written by someone else.

I'm also guessing that this is your first time in comp.lang.c because
you don't seem to understand the purpose of the newsgroup.  comp.lang.c
is for discussing the ins and outs of the C language as defined by the
ISO standard.  Networking is *not* part of the C language.

Billy Chambless' regular "Welcome to comp.lang.c!" posting contains
pointer to numerous platform-specific groups where you will be able to
get more helpful responses.

--

I believe we can change anything.
I believe in my dream.
    - Joe Satriani



Sat, 06 Jan 2001 03:00:00 GMT  
 write()'s to network stream are sent but not received
:   Problem is, the write's, while returning positive values, don't appear
: to work.  At least the remote system isn't receiving data.

How "large" are your writes?

As for write-up on writing netowrk prgramsn, you might try Stevens'
"Unix Network Proramming" Volume 1. That will have all sorts of good
stuff about writing good networked (TCP/UDP/IP) applications.

rick jones
--
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to email, or post, but please do not do both...
my email address is raj in the cup.hp.com domain...



Sun, 07 Jan 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problem receiving data from Network Stream using Async method

2. CAsyncSocket Send, Receive hanging after network disconnection

3. Network Stream Read/Write Problem

4. Control timeout period for a blocking CAsyncSocket's Send() and Receive()

5. Control timeout period for a blocking CAsyncSocket's Send() and Receive()

6. How to get DUN connection's #bytes sent/received

7. CFile not working properly, can't figure out why (last message not sent properly)

8. flushing a stream when file can't be written

9. UP and Down key's not being received

10. Source Safe Initialize is too slow when I'm not on the network

11. Receive Byte stream from COM Object

12. Webrobot to receive streaming data

 

 
Powered by phpBB® Forum Software