LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-22-2004, 08:13 AM   #1
becky_starr
Member
 
Registered: Jan 2004
Posts: 34

Rep: Reputation: 15
make connection and send message?


I would like to ask

if there are 3 pc

pc 1 sends message to pc 3 through pc 2, and pc 2 will run a usespace program to listen the packet(message) passed through it.

I wanna ask how I can send the packet back to pc 1 in the same userspace program since this packet should be forward to pc 3 (instead of backward) and connection can not be made.

how about I run another program in the userspace program?

I have tried if the progam is for connection, I can't run it from a program already running.?

How it can be done...


Thanks ~~~I need it in urgent.......
 
Old 02-22-2004, 08:49 AM   #2
krajzega
Member
 
Registered: Jan 2004
Location: Poland
Distribution: FreeBSD 5.1
Posts: 92

Rep: Reputation: 15
I dont know what exactly you mean, but I think that you are trying to send the packets from pc 1 to pc 3 and from pc3 to the pc 1 in the same time. Whether it's that, you should use asynchronical mode of those sockets (set it in application on pc2). Its quite easy, you have to use fnctl function, defined in fcntl.h header:

fnctl(int socket, F_SETFL, O_NONBLOCK);

..for both sockets.
I dont know whether it's exactly what you mean, but this feature will allow your application to send packets from pc 1 to pc 3 and pc 3 to pc 1.
 
Old 02-22-2004, 12:47 PM   #3
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
becky you have posted variations of this same damn question over and over. nobody really understands exactly what you're talking about; i've already tried to help you multiple times. what do u expect? someone to write the shit for u?
 
Old 02-22-2004, 10:41 PM   #4
becky_starr
Member
 
Registered: Jan 2004
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks infamous and krajzega~~

I have got what I want already~~

But I want to improve the stuff I write~~~

There are always many methods to achieve the same goal, I would like to seek opinions to polish my skills~~

Thanks those who have helped me ~~~
 
Old 02-22-2004, 11:12 PM   #5
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
if you want to improve then lets see your code.
 
Old 02-23-2004, 05:21 AM   #6
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Rep: Reputation: 30
infamous: chill dude - there's no need to get uppity about multiple postings... I agree it's annoying but lets face it, it's not gonna hurt anyone (I haven't seen 1 person so far that would get grumpy if you did it)...

Becky, i agree with infamous - if you would like some help then please post your code and then we can see what you already have
 
Old 02-23-2004, 05:23 AM   #7
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Rep: Reputation: 30
Oh and also, Becky's a newbie - remember when u were? I do and man I couldn't have done it without the help of LQ (and a real good friend of mine)...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Send simple email message in C zaichik Programming 5 09-09-2005 11:27 AM
Send message over console stefaandk Linux - Newbie 4 08-15-2005 08:48 PM
how to send a message to one sys to another. bruse Linux - Networking 4 06-20-2005 04:46 AM
How to use command to send message to others? chinaundead Linux - General 4 05-09-2004 10:09 PM
Send message to window u4113072 Linux - Software 0 10-18-2002 05:17 AM

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

All times are GMT -5. The time now is 10:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration