TCP Client Socket C Programming (Send/Receive)
Hi All,
I have sent data and received data from the server. I'm using TCP Client Socket C Programming I have connected the server and I send the data but the server can't receive it (Note: Server successfully connected). This is my data example: '050560000000001414103037323330......' (1032 bytes and Decimal 514). how I can read this data and send it to the server socket using the C program? Please advice. my doubts 1. How to assign these big bytes variables statically using the c program. 2. How do I read this big byte and send them to the socket send method? Below mentioned my code. Please find it. (Note: Server successfully connected but server not received and not sent) Code:
int main(int argc, char *argv[]) |
Verify your program via running `netcat` as server:
Code:
nc -l -p 90190 |
Quote:
Thanks for your response. I'm using POS Linux terminal and my server is ASTREX. |
That's commendable. I suggest you test your program with `netcat` running as server: `nc -l -p 90190`
|
Quote:
|
FYI, this is a popular guide to Network Programming http://www.cs.columbia.edu/~danr/cou...1-sockhelp.pdf
|
Now that you mention it 90190 might be above the maximum (65535) -- most likely it is interpreted as 24654 (mod 65536) or as invalid value.
|
Quote:
|
1 Attachment(s)
If you add the missing includes to the program it sort of works.
Terminal 1: Code:
$ netcat -l -p 90190 Code:
$ echo 'Ezt a kort a pivel szamold ki' | ./nather Code:
$ netcat -l -p 90190 |
Quote:
|
All times are GMT -5. The time now is 10:05 PM. |