473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Linux Network Programming: send() crashes program

158 100+
Hello Bytes,

I am writing a network program in c++ on Linux Debian x86.

I am using tcp sockets to communicate with other processors all very standard stuff.

However Im stuck at one hump, when I try to call send() on a socket where the other machine loss power of crashed. Send crashes my program, no return of -1 just crash with no output.

My Send Command:
Expand|Select|Wrap|Line Numbers
  1.  
  2.  if (send(vars->Nodes[n].sockfd, buf3, strlen(buf3), 0) == -1) {
  3.        vars->Nodes[n].ready = 0;
  4.        vars->Nodes[n].connected = 0;
  5.        perror("sendTimeCode");
  6.  }
  7.  
Any thoughts?
Jun 9 '10 #1

✓ answered by kardon33

Nevermind, my dumb mistake.

It was throwing a connection reset by peer error but I missing it and the next time I called send() it crashed which is ok.

1 2121
kardon33
158 100+
Nevermind, my dumb mistake.

It was throwing a connection reset by peer error but I missing it and the next time I called send() it crashed which is ok.
Jun 9 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jay | last post by:
Hi, I implemeneted an FTP client and server long time back using Java. I found sockets porgramming in java quite useful and easy to handle. I now wanted to implement a similar program using C++....
6
by: Da Vinci | last post by:
Hello, I am starting a project that requires data transfer via UDP. It will be between two different computers. I have all of the information that needs to be sent in the packet and what the...
6
by: John Walton | last post by:
Hello, everyone. I just began school, and they already assigned us science fair. Since I'm in 8th grade, I get to do demonstrations for our projects. I'm probably going to demonstrate Python's...
1
by: becker | last post by:
Hi, how are you? I have been reading networking related source code written in C lately, and I have encountered so many structures that I have no clue of. Could anybody tell me how to get somewhat...
2
by: ppuniversal | last post by:
Hello, Can someone tell a good Tutorial on Network Programming in C++, except Beej's Guide and Vijay Mukhi's tutorials. I want to make a Client Server application in C++ which will involve...
9
by: Mex | last post by:
Hi, I'm looking for a good book for beginners about Network Programming. Besides Stevens' book, I would like something specific for C++ language. Any suggestions? Thanks in advantage, Massimo
0
by: mvjohn100 | last post by:
Hello friends, I am newbie to the world of linux network programming... I be thankful if got a information how can I start it. Is there any framework for networking programming in linux. ...
3
by: mvjohn100 | last post by:
hello, As a newbie to the world of Linux network programming. I wish to know is there any c++ framework for this.... Thanks, john
1
by: yukijocelyn | last post by:
Hi I am currently programming a TCP socket to transfer large files. My client is running on .NET application and my server is running on Java. I am using TCP socket to transfer file over the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.