[beepy-devel] basic session initialization questions
Status: Alpha
Brought to you by:
jpwarren
|
From: Pete S. <si...@uc...> - 2005-04-11 17:51:51
|
I'm trying to get a JAVA client talking to a Python server using BEEP.
I have the demo BEEPy echo client and server working, and I have the
demo JAVA beepcore echo client and server working. I've made my own
versions of the Java client and the Python server, and I'm having
trouble getting them to talk to each other.
I start my Python server, and it outputs this:
npad$ twistd -ny npad-server.py
2005/04/11 11:00 MDT [-] Log opened.
2005/04/11 11:00 MDT [-] twistd 1.3.0rc1 (/usr/bin/python2.3 2.3.5) starting up
2005/04/11 11:00 MDT [-] reactor class: twisted.internet.default.SelectReactor
2005/04/11 11:00 MDT [-] Loading npad-server.py...
2005/04/11 11:00 MDT [-] <string> INFO: npad-server starting
2005/04/11 11:00 MDT [-] <string> DEBUG: instantiating a BeepServerFactory
2005/04/11 11:00 MDT [-] <string> DEBUG: setting the factory's profile to npadprofile
2005/04/11 11:00 MDT [-] <string> DEBUG: establishing a BEEP Listener on port 1976
2005/04/11 11:00 MDT [-] <string> INFO: npad-server exiting
2005/04/11 11:00 MDT [-] Loaded.
2005/04/11 11:00 MDT [-] beepy.transports.tcp.BeepServerFactory starting on 1976
2005/04/11 11:00 MDT [-] Starting factory <beepy.transports.tcp.BeepServerFactory instance at 0xb7a7d6ac>
2005/04/11 11:00 MDT [-] set uid/gid 5462/96
It's waiting patiently. I had a struggle figuring out how to get log
messages from the Java beepcore code, but I finally did. With the
Python server running, my Java client outputs this:
npad$ java edu/ucar/scd/nets/npad/NpadClient -port 1976 localhost
0 [main] INFO npad.NpadClient - Apache Jakarta Commons Logging initialized, using Log4JCategoryLog
75 [main] INFO edu.ucar.scd.nets.npad.NpadClient - Parsing command-line arguments
76 [main] INFO edu.ucar.scd.nets.npad.NpadClient - Initiating a TCP session with the server on localhost:1976
544 [main] DEBUG org.beepcore.beep.transport.tcp.TCPSession - sendGreeting
550 [main] DEBUG org.beepcore.beep.core.Frame - RPY 0 0 . 0 59
553 [main] DEBUG org.beepcore.beep.transport.tcp.TCPSession - Wrote the following
RPY 0 0 . 0 59
Content-Type: application/beep+xml
<greeting></greeting>END
553 [main] DEBUG org.beepcore.beep.transport.tcp.TCPSession - State changed to 1
555 [TCPSession Thread #0] DEBUG org.beepcore.beep.transport.tcp.TCPSession - Processing next frame
556 [TCPSession Thread #0] DEBUG org.beepcore.beep.transport.tcp.TCPSession - RPY 0 0 . 0 114
558 [TCPSession Thread #0] DEBUG org.beepcore.beep.transport.tcp.TCPSession - Content-Type: application/beep+xml
<greeting>
<profile uri="http://npad.ucar.edu/profile"/>
</greeting>
559 [TCPSession Thread #0] DEBUG org.beepcore.beep.core.ChannelImpl - Channel::postFrame
561 [TCPSession Thread #0] DEBUG org.beepcore.beep.core.ChannelImpl - Notifying reply listener.=>org.beepcore.beep.core.SessionImpl$GreetingListener@1ef9157
564 [TCPSession Thread #0] DEBUG org.beepcore.beep.core.ChannelImpl - Freed up 114 bytes on channel 0
564 [TCPSession Thread #0] DEBUG org.beepcore.beep.core.ChannelImpl - recvWindowUsed = 114 recvWindowFreed = 114 recvWindowSize = 4096
565 [TCPSession Thread #0] DEBUG org.beepcore.beep.transport.tcp.TCPSession - Wrote: SEQ 0 114 4096
566 [TCPSession Thread #0] ERROR org.beepcore.beep.transport.tcp.TCPSession - Problem with RPY: Invalid content type for this message
567 [TCPSession Thread #0] DEBUG org.beepcore.beep.transport.tcp.TCPSession - State changed to 8
569 [TCPSession Thread #0] DEBUG org.beepcore.beep.transport.tcp.TCPSession - Session listener thread exiting. State = 8
NpadClient: Error connecting to localhost:1976
Greeting exchange failed
npad$
...and the Python server logged only
2005/04/11 11:00 MDT [BeepServerProtocol,0,127.0.0.1] Failure: twisted.internet.error.ConnectionLost: Connection to the other side was lost in a non-clean fashion.
So the client sent an empty greeting, the server responded with a
profile, and then the client died. The client failed inside the
beepcore TCPSessionCreator.initiate function, before it tried to open a
channel. I confess I don't quite understand the details of profiles and
URIs yet, but I think this problem is happening before profile selection
happens.
Help!
At the least, can I turn on more logging in the BEEPy code, so I can see
more of what's happening? It'd be nice to see logs of the greeting
exchange.
-- Pete
|