Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Jun 1st, 2006, 8:13 PM   #1
hbe02
Hobbyist Programmer
 
hbe02's Avatar
 
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3 hbe02 is on a distinguished road
sockets

These are my initializations, assume all is correct with connecting to windows etc... i want to recieve data form the client on the socket "incoming" and i want to send information to the client on socket "outgoing"
these are some form of my initializations, assume all is correct
int incoming = socket(AF_INET, SOCK_DGRAM, 0);
int outgoing = socket(AF_INET, SOCK_DGRAM, 0);
sockaddr_in & server;
sockaddr_in & client;

assignserver(server) ; //this function assigns IP and port to my station (server)
assignserver(client) ; //this function assigns IP and port to my station (server)

bindfunction(incoming,server) // this binds server(me) to socket incoming


here is the psuedocode of what i want to do ... how can i do it?

while(true)
{
	if(recieve anything on socket incoming)
		{

			process information;
		}
	else // nothing is recived
		{
			output some data to client on the outgoing socket;
		}
}

so what i want to do is keep sending data on the outgoing socket forever and ever. when i recieve data on the incoming socket, i want to stop sending on the outgoing socket and process the information i recieve on the incoming socket..
i have tried WSANETWORKEVENTS.. which didnt work out very well since i couldnt find proper sources.. can someone please give me proper code or link.. where i can see what i want to do in action so i can understand and do the same...
thanks
hbe02 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:21 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC