LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-19-2009, 10:21 PM   #1
RaySwen
LQ Newbie
 
Registered: Mar 2009
Posts: 6

Rep: Reputation: 0
Question Wired Error: Address Family not supported by protocol


I am writing a UDP respond server. It works well, when i want to declare a new variable in the main function. No matter what type of the variable is, the sendto() method will arise an error "Address Family not supported by protocol". It is a running error.

What's wired is that i haven't used that variable. I thought it might be an error from stack or somewhere, so i restart the Linux. However, it still exists. And if i delete that line of declaration, the error goes. It really confused me.

Could anybody offer some help or advice? Thanks
My Linux: Ubuntu 8.10 Desktop, kernel 2.6.27
 
Old 03-26-2009, 05:50 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 03-26-2009, 06:54 AM   #3
Biddle
Member
 
Registered: Jan 2009
Posts: 37

Rep: Reputation: 17
Can you produce a minimal example which displays this behaviour?
 
Old 04-07-2009, 08:08 PM   #4
RaySwen
LQ Newbie
 
Registered: Mar 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Hey guys, i've fixed it up. The error is raised by the recvfrom() function. The last parameter len must be assigned a number before using it. I thought it could be assigned when the server receives the messages, which proves to be wrong.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
socket: Address family not supported by protocol noir911 SUSE / openSUSE 1 03-10-2009 04:48 AM
Samba error Address Family not supported by protocol dssrjol Linux - Networking 2 04-21-2007 04:36 AM
Centos - no Yum, up2date, and Address family not supported yogaboy Linux - Networking 2 01-23-2007 04:16 AM
socket: Address family not supported by protocol utumno Linux - Networking 0 12-05-2004 03:19 AM
SSH - socket: Address family not supported by protocol SkyLinePL Linux - Networking 4 09-24-2004 12:03 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration