LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-17-2011, 06:15 AM   #1
srieindhoven
LQ Newbie
 
Registered: Feb 2011
Posts: 3

Rep: Reputation: 0
Dynamic Broad cast message listen


Hey all ,

I am new to socket programming.

I created UDP socket like this

void receiveInit()
{
int addr_len;
sock_fdL =socket(AF_INET, SOCK_DGRAM, 0);
if ( sock_fdL == -1 ) // Error occurred
{
printf("Failed Creare Started\n");
return ;
}
memset(&addrL, 0, sizeof(addrL)); // Create address from which we want to receive, and bind it
addrL.sin_family = AF_INET;
addrL.sin_addr.s_addr = INADDR_ANY;
addrL.sin_port = htons(kPortNumberL);
if ( bind(sock_fdL, (struct sockaddr*)&addrL, sizeof(addrL)) < 0 )
{
printf("Failed bind Started\n");
return ;
}

printf("\n Listening Socket initilized .. waiting for receive data \n");
addr_len = sizeof(addrL);
recvfrom(sock_fdL, Recvsocketstring, kBufferSize, 0, (struct sockaddr*)&addrL, (int*)sizeof(addrL) );

}

I would like to create Dynamic threaD.

Whenever i recived a message that message has to stored in "Recvsocketstring" in this string.It has to do automatically ... If i haven't recived any message then i would like to return back from this loop ..

Last edited by srieindhoven; 03-17-2011 at 06:16 AM.
 
  


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
Restricting Dynamic Ipaddress by based on Dynamic DNS host names karthik9110 Linux - Newbie 5 12-13-2009 11:46 PM
Broad band installation--help thewiz103 Linux - Newbie 1 11-30-2008 04:32 PM
HOw to get Broad cast address using ioctl( ) and print it... touqeer.ansar Programming 1 07-03-2006 11:35 AM
Broad cast and multicast addr node047 Linux - Networking 1 04-04-2005 10:30 AM
broad band connector vadirajcs Linux - Distributions 0 06-17-2004 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:12 AM.

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