[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Help needed

tijo

1/11/2008 2:16:00 AM

Hi mate

i need o do a python program to connect 2 systems using TCP/IP and
UDP. Also i need to check the performance of these two protocols (how
many bytes received and how much time took). I havent worked in python
earlier and have no idea of this. Could someone pls help me. I created
a program which can connect between 2 systems using these UDP and TCP/
IP protocols. I dont know how to check the rest like how many bytes
send or how much time taken
since this is part of my course work could someone please help me
thanks in advance.

tijo
6 Answers

Devraj

1/11/2008 2:32:00 AM

0

Sorry to diverge from the topic, but is there a reason you need to
develop something like again? I would assume that there would be
numerous utilities that would do this for you.

If you want these features in your applications, why don't you
consider incorporating existing tools/libraries into your program.

Just trying to reason why you would want to write a network metrics
program over again.

On Jan 11, 1:15 pm, tijo <tijotom...@gmail.com> wrote:
> Hi mate
>
> i need o do a python program to connect 2 systems using TCP/IP and
> UDP. Also i need to check the performance of these two protocols (how
> many bytes received and how much time took). I havent worked in python
> earlier and have no idea of this. Could someone pls help me. I created
> a program which can connect between 2 systems using these UDP and TCP/
> IP protocols. I dont know how to check the rest like how many bytes
> send or how much time taken
> since this is part of my course work could someone please help me
> thanks in advance.
>
> tijo

Ivan Novick

1/11/2008 4:29:00 AM

0

On Jan 10, 6:15 pm, tijo <tijotom...@gmail.com> wrote:
> Hi mate
>
> i need o do a python program to connect 2 systems using TCP/IP and
> UDP. Also i need to check the performance of these two protocols (how
> many bytes received and how much time took). I havent worked in python
> earlier and have no idea of this. Could someone pls help me. I created
> a program which can connect between 2 systems using these UDP and TCP/
> IP protocols. I dont know how to check the rest like how many bytes
> send or how much time taken
> since this is part of my course work could someone please help me
> thanks in advance.
>
> tijo

So you want to write a program using sockets then?

http://docs.python.org/lib/module-s...

Regards,
Ivan Novick
http://www....

tijo

1/11/2008 4:52:00 AM

0

Hi mate
i created the socket and the connection with tcp and udp i dont know
how to check the bytes send and time
could you help me with this

cheers
tijo

A.T.Hofkamp

1/11/2008 7:48:00 AM

0

On 2008-01-11, tijo <tijotomjoy@gmail.com> wrote:
> Hi mate
> i created the socket and the connection with tcp and udp i dont know
> how to check the bytes send and time
> could you help me with this

Have a look at the time or timeit modules.

Albert

Hyuga

1/11/2008 2:49:00 PM

0

On Jan 10, 9:15 pm, tijo <tijotom...@gmail.com> wrote:
> Hi mate
>
> i need o do a python program to connect 2 systems using TCP/IP and
> UDP. Also i need to check the performance of these two protocols (how
> many bytes received and how much time took). I havent worked in python
> earlier and have no idea of this. Could someone pls help me. I created
> a program which can connect between 2 systems using these UDP and TCP/
> IP protocols. I dont know how to check the rest like how many bytes
> send or how much time taken
> since this is part of my course work could someone please help me
> thanks in advance.
>
> tijo

The standard library documentation, while lacking in some areas, is
very much your friend here:

From http://docs.python.org/lib/socket-ob... (emphasis mine)
send(string[, flags])
Send data to the socket. The socket must be connected to a remote
socket. The optional flags argument has the same meaning as for recv()
above. *Returns the number of bytes sent.*

recv(bufsize[, flags])
Receive data from the socket. The return value is a string
representing the data received.

For timing you can probably use the timeit module (http://
docs.python.org/lib/module-timeit.html) but I'm not really sure how
you're defining "performance". I mean, I can already tell you that
overall UDP will be "faster", as it has much less overhead. Surely
your course has covered this...

Hyuga

Bjoern Schliessmann

1/11/2008 8:25:00 PM

0

Devraj wrote:

> Sorry to diverge from the topic, but is there a reason you need to
> develop something like again?

It's obvious, isn't it?

> On Jan 11, 1:15 pm, tijo <tijotom...@gmail.com> wrote:
>> I dont know how to check the rest like how many bytes send or how
>> much time taken since this is part of my course work could
>> someone please help me thanks in advance.

Homework.

Regards,


Björn

--
BOFH excuse #183:

filesystem not big enough for Jumbo Kernel Patch