Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Socket dll #309221
02/08/10 00:55
02/08/10 00:55
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline OP
Expert
Damocles_  Offline OP
Expert

Joined: Feb 2009
Posts: 2,154
Hi, is there any dll developer (looking at GSTNet or ANet) that can implement socket_send and socket_receive commands? (as in the Pro version)

For example to set up a raw Java-Acknex connection bridge,
without use a predefined comunication protocol.

Re: Socket dll [Re: Damocles_] #309296
02/08/10 14:27
02/08/10 14:27
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
I don't know how the java connection bridge would work, but opening a simple tcp/udp socket is no problem.

Btw. ANet offers you udp socket function (originally implemented for searching servers in LAN), maybe they are what you want.

If not, just PM me with more details.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: Socket dll [Re: Dark_samurai] #309301
02/08/10 15:10
02/08/10 15:10
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline OP
Expert
Damocles_  Offline OP
Expert

Joined: Feb 2009
Posts: 2,154
Basically I need a TCP-IP socket connection, as described
in the manual.
Where I can send raw bytestreams to and from
another socket (wich could be either a gamestudio plugin or
Java).
Important is, that the connection behaves like a raw socket
connection (without any automatic initialisation data send
back and forth, so basically having no predefined protocol)
so that the serversocket can be implemented in
any other enviroment, not just to comunicate between
two instances of the dll.

Code:
// Control a GALEP device by sending script commands to its GalepX socket

STRING* strScript = // command script that lets GALEP blink its LEDs
"#include \"gxAPI/gxBasic1.h\"
string s = gxGetCurrentEndDevice();
gxDeviceIdentity(s);
";

TEXT* txtReceive = { flags = SHOW; }

function main()
{
// open a TCP socket on GalepX port 1233 
   if (!socket_connect("localhost",1233,1)) {
      printf("Can't connect to GalepX!");
   } else
   {
// send the script to the socket
      var size = str_len(strScript);
      var sent = socket_send(_chr(strScript),size);
      if (sent) txt_addstring(txtReceive,strScript);
   
// display the response   
      while(1) {
        char input[1000];
        int received = socket_receive(input,1000);
        if (received > 0) {
          input[received] = 0; // add the end mark
          txt_addstring(txtReceive,input);
        }
        wait(1);
     }
  }
}




Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1