LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   make connection and send message? (https://www.linuxquestions.org/questions/programming-9/make-connection-and-send-message-149094/)

becky_starr 02-22-2004 07:13 AM

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.......

krajzega 02-22-2004 07:49 AM

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.

infamous41md 02-22-2004 11:47 AM

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?

becky_starr 02-22-2004 09:41 PM

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 ~~~

infamous41md 02-22-2004 10:12 PM

if you want to improve then lets see your code.

AMMullan 02-23-2004 04:21 AM

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 :)

AMMullan 02-23-2004 04:23 AM

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)...


All times are GMT -5. The time now is 11:43 PM.