|
|
|
|
||||||
| linux.debian.user debian-user@lists.debian.org. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Dear all,
I'm developing an applications that is using UDP sockets but instead of creating a socket that received packets from the transport layer I have created the socket at the IP level, so I receive the message from IP layer. The problem I have that now, is that when a packet is sent and it is bigger than the MTU, the IP layer fragment it and I receive the fragments. So to reassemble them, I'd like to use the same functions, the same methods that the IP level use, I mean, it's something that has been done and that is been used so I thing that it's not necessary to create it again and probably doing it worst, therefore my question is if someone knows where are that functions and how to use them... there's any "#include....h" y can use to use them...? Thanks in advance __________________________________________________ _______________ Descarga gratis la Barra de Herramientas de MSN http://www.msn.es/usuario/busqueda/b...NINGTEXT_MSNBH -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
2007/4/27, J HU <judowold@hotmail.com>:
> Dear all, > > I'm developing an applications that is using UDP sockets but instead of > creating a socket that received packets from the transport layer I have > created the socket at the IP level, so I receive the message from IP layer. Why are you using UDP and not TCP sockets ? Maybe the task you are trying to achieve would be "easier" with TCP sockets. Regards, Sergio Cuellar -- "Meine Hoffnung soll mich leiten Durch die Tage ohne Dich Und die Liebe soll mich tragen Wenn der Schmerz die Hoffnung bricht" -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Hi,
No, it must be UDP, although I think that if I use TCP, the problem will be the same because is the IP layer who makes the fragments and how my socket is listening at IP level I get IP fragments and not complete datagrams. So I think that using the functions that are implementing for the ip I could reassemble the fragments in the same way that it's done in a normal way. But my problem is that I don't know how to use them and how to do... Regards ----Original Message Follows---- From: "Sergio Cuéllar Valdés" <herrsergio@gmail.com> To: debian-user@lists.debian.org Subject: Re: reasselbling IP fragments Date: Fri, 27 Apr 2007 10:52:01 -0500 2007/4/27, J HU <judowold@hotmail.com>: >Dear all, > >I'm developing an applications that is using UDP sockets but instead of >creating a socket that received packets from the transport layer I have >created the socket at the IP level, so I receive the message from IP layer. Why are you using UDP and not TCP sockets ? Maybe the task you are trying to achieve would be "easier" with TCP sockets. Regards, Sergio Cuellar -- "Meine Hoffnung soll mich leiten Durch die Tage ohne Dich Und die Liebe soll mich tragen Wenn der Schmerz die Hoffnung bricht" -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org __________________________________________________ _______________ Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN Amor & Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349 -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Hi!
I'll like some advices about how to create a time out in a debian. I need at least to do 4 different actions, for example: I have 4 threads and each one is going to create some data and store it in a structure (it's not a periodic task and each thread work with different structures and store different kind of data). So I'd like to erase each data after a X seconds and what I'm going to do is store in a queue the time when I'd like to erase that data and a pointer to the data. Then using posix-timers, one different for each thread, and using a different signal for each one (SIG_ALRM, SIGUSR1, SIGUSR2,...) I will program them and each one will consult a different queue to erase the data and auto re-programing with a new elapsed time. I don't like the idea of using posix because I need a new signal each time, and I can't pass any parameter to the function executed when the timer elapse. I don't know if there are more solutions if there's another way... Is there anyone who knows how to create better time outs? Thanks a lot! __________________________________________________ _______________ ¿Estás pensando en cambiar de coche? Todas los modelos de serie y extras en MSN Motor. http://motor.msn.es/researchcentre/ -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Fri, Apr 27, 2007 at 04:46:26PM +0000, J HU wrote:
> I'll like some advices about how to create a time out in a debian. > So I'd like to erase each data after a X seconds and what I'm going to do > is store in a queue the time when I'd like to erase that data and a pointer > to the data. > Does it have to be within a single thread? If it was a shell I'd run "sleep Xs;erase", and similar if I was in python. The problem with a queue is that for asyncronous input [thread, processes, whatever], the delay and pointer touples won't be sorted at all, while ideally they would be sorted by delay. You could have a separate program that received on stdin touples that it then turned the delay touple into a specific time-to-erase that then got sorted. Stdin could be from a named pipe (fifo) from the async threads/processes. I know I'm being process-centric but its been years since I used threads and then only briefly, but the concept of a program component (separate thread, separate process, or just a function called by the program's main loop) that pulls the async touples, orders them into a new fifo, and then processes any erase-requests that have expired, is valid. Doug. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
Hi, Thanks Doug for your answer. But I really need to have different threads, I could join two of them but it continues beeing more than one thread. Perhaps my question should be what are the way to creat a timer/Time out... I know the posix timers but there's another solutions? Thanks again! ----Original Message Follows---- From: Douglas Allan Tutty <dtutty@porchlight.ca> To: debian-user@lists.debian.org Subject: Re: Time Outs Date: Fri, 27 Apr 2007 19:24:04 -0400 On Fri, Apr 27, 2007 at 04:46:26PM +0000, J HU wrote: > I'll like some advices about how to create a time out in a debian. > So I'd like to erase each data after a X seconds and what I'm going to do > is store in a queue the time when I'd like to erase that data and a pointer > to the data. > Does it have to be within a single thread? If it was a shell I'd run "sleep Xs;erase", and similar if I was in python. The problem with a queue is that for asyncronous input [thread, processes, whatever], the delay and pointer touples won't be sorted at all, while ideally they would be sorted by delay. You could have a separate program that received on stdin touples that it then turned the delay touple into a specific time-to-erase that then got sorted. Stdin could be from a named pipe (fifo) from the async threads/processes. I know I'm being process-centric but its been years since I used threads and then only briefly, but the concept of a program component (separate thread, separate process, or just a function called by the program's main loop) that pulls the async touples, orders them into a new fifo, and then processes any erase-requests that have expired, is valid. Doug. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org __________________________________________________ _______________ Horóscopo, tarot, numerología... Escucha lo que te dicen los astros. http://astrocentro.msn.es/ -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
![]() |
| Outils de la discussion | |
|
|