[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Client - Server Program Help !! (in C on Linux)



On Mon, 19 Nov 2001 22:00:19 +0530
<shyamk@eth.net> wrote:

> Hi everybody !
>       I had posted a few doubts to this list the last week 
> about network programming in C on Linux .(rpc, tcp ,udp ,Unix Sockets) .
>      My tcp programs , the server , running from 10.10.1.4 (listening at 9888)
> and the client running from 10.10.1.15  ,
> do not show the data the other is sending !

Please take your question to comp.os.linux.development.apps or a similar
newsgroup as there are many expert sockets programmers there.

>    If you go by the results of 
> netstat -an|grep 9888
> you will find that the 2 programs , have actually , established connection , etc. 
> 
>   But once my server types something and presses
> an Enter key , nothing can be seen on the screen of the client ,
>  and once my client types something and presses
> an Enter key , nothing can be seen on the screen of the server .
> 
> Is it that I need to program in an EOL or EOT stuff ?

Imagine at some level you are using read() and write().  The read()
call does not need any special EOL, it only needs data to be
presented by the kernel via the socket.  But how is your server
accepting connections?  Your code is probably blocked somewhere
in a system call (what happens when the client does a read() on
the socket if the server never does a write()?).

Anyway, it's impossible to remotely debug code we can't see.  But don't
post it here, try the newsgroup.

-- 
Eric G. Miller <egm2@jps.net>



Reply to: