473,396 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Re: sending executable data over network..

Le Tuesday 24 June 2008 08:59:40 Piyush Anonymous, vous avez écritÂ*:
hi,
i wish to change the way the function definition at run time in a running
server. new function code which is to be executed is provided by a client
at different location.
i am getting it by reading a file and sending it using makefile() with
server/client connected using sockets.

how can make the lines received in a string array as new function
definition? or should i receive it in a different way?

is there any better way to do the entire thing?
One way is to transmit the code as a string and compile it on server-side with
the 'compile' builtin function. Another is to compile it on client-side and
transmit the resulting code object with the marshal module but there are many
restrictions on it (specially the fact that the client and server will have
to run the same python version) so carefully read the docs first. I'd choose
the first solution, eventually using the pickle module to avoid encoding
problems.

--
Cédric Lucantis
Jun 27 '08 #1
1 1557
Cédric Lucantis wrote:
Le Tuesday 24 June 2008 08:59:40 Piyush Anonymous, vous avez écrit :
>hi,
i wish to change the way the function definition at run time in a running
server. new function code which is to be executed is provided by a client
at different location.
i am getting it by reading a file and sending it using makefile() with
server/client connected using sockets.

how can make the lines received in a string array as new function
definition? or should i receive it in a different way?

is there any better way to do the entire thing?

One way is to transmit the code as a string and compile it on server-side with
the 'compile' builtin function. Another is to compile it on client-side and
transmit the resulting code object with the marshal module but there are many
restrictions on it (specially the fact that the client and server will have
to run the same python version) so carefully read the docs first. I'd choose
the first solution, eventually using the pickle module to avoid encoding
problems.
You may want to take a look at Twisted Python Perspective Broker. I believe it
does what you are looking for.

-Larry
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tim Black | last post by:
My application requires sending a large piece (~2MB) of data to several devices on a network via TCP sockets. I have experimented with different methods for doing this and this has raised some...
2
by: klkuenzel | last post by:
Can you run a VB.NET executable from a network share on a server. My company does this with VB 6.0. Example ..Net executable on network file server called Toky client computer has a shortcut on...
4
by: yaron | last post by:
Hi, I have a problem when sending data over TCP socket from c# client to java server. the connection established ok, but i can't send data from c# client to java server. it's work ok with...
7
by: John Bailo | last post by:
I wrote a c# web service that sends an XmlDocument as a return type. When I run it on a w2k iis machine, it takes 35s to 45s to send the data to a client (I wrote a smart client c# app to consume...
4
by: david | last post by:
hello, I have a client/server application. the server capture picture from webcam and send it to every client connected to it.the network part works good and the capture from webcam too. I...
17
by: =?Utf-8?B?V2VuZHkgRWxpemFiZXRo?= | last post by:
Questions about creating an .net ‘executable’ 2005 that will not remained installed once a user enters some data into the application. I also want this applcation to not require any previous...
0
by: Jean-Paul Calderone | last post by:
On Wed, 25 Jun 2008 10:28:10 -0500, Larry Bates <larry.bates@websafe.com`wrote: Twisted PB goes out of its way to *not* allow arbitrary code specified by a peer to be executed, actually. :) It...
2
by: erbilkonuk | last post by:
Hi everyone, I have been developing a project that is composed of one windows service and one ASP.NET web site. The windows service and ASP.NET web site reside on the same server. I want to send...
1
by: Paulo | last post by:
Hi, can asp.net (2.0 C# VS 2005) send some kind of information via TCP/IP to a computer that will be on the local network? Should the destination computer have a executable listening the data...
2
by: =?ISO-8859-1?B?RulybmFz?= | last post by:
Hey all, I have a URGENT problem and I hope someone could help me... scenery: I have a windows app, coded using C# (framework 1.1 - VS2003)... The exe and dlls of the app is are stored in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.