Retreiving data from Java server through WinSock COM object 
Author Message
 Retreiving data from Java server through WinSock COM object

Hi,

I'm trying to pick up a list of available rooms on my chat server (NFC Java
Chat Server) from an ASP page. To acheive this I'm emulating a chat client
through a WinSock DLL (Dimac's W3 Sockets). This seems to be working and I
can successfully log in & out from the server (confirmed by monitoring the
server) but I'm having trouble picking up the return messages from the
server. The code I'm using is:

----------------------------------------------------

Set socket = Server.CreateObject("Socket.TCP")

Function getRooms(strServer,strUser,strPass)
socket.Host = strServer
socket.Open()
   socket.SendLine("<message value=""/signon " & strUser & " " & strPass & "
/>")
   socket.SendLine("<message value=""/rooms />")
   socket.SendLine("<message value=""/quit />")
   socket.WaitForDisconnect()
   getRooms = ("<blockquote><pre>" + socket.Buffer + "</pre></blockquote>")
socket.Close()
End Function

Response.Write(getRooms(" [server ip & port] "," [username] "," [password]
"))

----------------------------------------------------

This executes without error but the buffer is always empty. I've also tried
using socket.GetLine() and socket.GetText(4) but then the function hangs,
apparently waiting for input, and eventually times out. What am I doing
wrong here? I have the source code for a Flash client that works with the
server and from looking at the debug output I can see the following messages
being sent/received when a user logs in:

   Sending:  <message value="/signon    FOOUSER    foopass" />
   Received:  <message value="/ack_signon    FOOUSER" />
   Sending:  <message value="/rooms" />
   Sending:  <message value="/users" />
   Received: <message value="Welcome to NFC 1.0" />
   Received:  <message value="/rooms    Room1" />
   Received:  <message value="/users    FOOUSER" />

As you can see this is in XML but that shouldn't affect things. I mean it's
still just strings of text and I should be able to send/receive them from
any socket client, right? Does anyone out there have any experience of a
similar scenario? Any help greatly appreciated!

Ola Tuvesson



Wed, 16 Mar 2005 07:40:40 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Retreiving data from Java server through WinSock COM object

2. Changing the Location of the NET FILE Directory in the BDE

3. HELP ME

4. Text screen buffer question

5. Passing arrays to COM java objects from JScript (Server Side)

6. Java Bean as COM object in VB.NET

7. Java COM objects

8. HOW TO RETREIVE DATA FROM SQL SERVER USING RDO

9. Accessing the web server's Printer object from a VB6 COM object

10. Accessing the web server's Printer object from a VB6 COM object

11. Call to Java COM inside VB COM

12. Sending socket data from VB client to a JAVA based server

 

 
Powered by phpBB® Forum Software