Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Socket communication via TCP-IP

New Here ,
Nov 27, 2006 Nov 27, 2006
Hi,

I am new to CF and would like to establish TCP-IP socket communication with a remote server. How can I exchange XML messages with a remote server / port via TCP-IP. Do I need to use the event gateways of does CF offer another way of setting up socket communication ?

Many thanks in advance !
John
TOPICS
Event gateways
2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 28, 2006 Nov 28, 2006
You can use the supplied socket gateway to listen on a port for messages from the other server and repsond to those messages fairly easily.

Triggering the start of such a conversation would require a new socket class that would create a connection.

So if you only need a passive interface then you're OK, if you need to initiate the data transfer you have a lot more code to write
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2007 Jun 19, 2007
Hello, how would you create a new socket class to create a client connection?? Are you talking about writing a java class? I have an application which I need to communicate with another server via TCP with XML and am sitting here scratching my head. Socket gateway won't work because it can't initiate a connection (and is a basically a server-not a client). CFHTTP would be nice to use but it only communicates via http or https (thus the CFHTTP tag name). I need a CFTCP tag or similar. Ideas? Suggestions? Thanks. Dan
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 20, 2007 Jun 20, 2007
Hi,

I faced the same problem. A Java developer in my company created a java class which has been implemented in CF by a CFX tag. So from within my CF code I can call the java class with some parameters (server, port, body message). The java class then sends the body message (XML) to the external server which replies with an XML reply message. The java class then passes the XML reply message to the calling CF page as a local variable....
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 06, 2007 Jul 06, 2007
LATEST
Do I need to use the event gateways of does CF offer another way of setting up socket communication ?

I would say, yes, use the socket gateway that ships with Coldfusion. However, it has a functionality I cannot really understand. If you are a client setting up a socket to connect to the gateway, the gateway expects your code to have, beforehand, a value for the variable originatorID. Yet, originatorID is a large, unique integer that the gateway code generates when you connect. That seems to me to be a chicken-and-egg dilemma.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources