python socket usage

Bryan Olson fakeaddress at nowhere.org
Fri Aug 17 05:56:10 EDT 2007


Oğuz Yarımtepe wrote:
> As i read pickle module is Python-spesific. I need to talk with a Java 
> application and get the infortion that it will send. What i do right now is 
> listening a socket and reding the string that is sent by the java 
> application. So the java application is sending a string and i am reading and 
> parsing it and getting the related infortion i need. A more professional way 
> may be the reading the object itself. Is it possible to get the array for ex. 
> object that is sent from the Java application with sockets?

No. Sockets send and receive byte. Any transfer of higher-level
object values requires the sender to encode the values into bytes,
and the receiver to parse the bytes to construct an object; even
then the result is a value copy, not the object itself.

For many kinds of objects, there are libraries available to do
the encoding and parsing. If you need reference semantics, there
are "object request brokers".

Say more about your problem, and there's a good chance you'll
get more useful answers.


-- 
--Bryan



More information about the Python-list mailing list