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 (Grant, AndrewAMD), 911 guests, and 9 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
TCP with multiple clients #375249
06/24/11 15:47
06/24/11 15:47
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Hey guys! Okay, I have no idea what I'm doing in this area, so here's the deal as best as I can explain it:

I need to have an A8-based server communicate with several external devices by TCP (this is for a deal I'll elaborate on more as I am allowed to in future, but for now please accept these requirements).

I was looking at socket_connect and related functions, but they look severely limited (I don't see how I can send different data to different clients and listen for input from all clients).

I was also wondering if unprotected sessions could communicate with non-GS applications, but I guess it doesn't matter since it uses UDP, and I need to use TCP.

So can anyone more experienced with socket communication and the like recommend a means by which I can communicate with multiple clients connected by TCP/IP?

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: TCP with multiple clients [Re: JibbSmart] #375460
06/25/11 20:07
06/25/11 20:07
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
I've never used socket_connect, but it seems to me that it can only be used for clients. I couldn't find any way to open a server with it or other commands.

The usual way to do low level networking on windows is to use Winsock. You can find many tutorials on that subject, again I haven't used it.
I don't know if it is necessary to create an wrapper dll or if you can call the WSA functions natively.

Re: TCP with multiple clients [Re: SchokoKeks] #375462
06/25/11 20:15
06/25/11 20:15
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
That makes sense. I'm pretty sure I used Winsock for the UPnP plugin (it's all a bit fuzzy -- I really was just mish-mashing stuff together until it worked), so I guess I could do it again for this.

Cheers!

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: TCP with multiple clients [Re: JibbSmart] #376069
06/29/11 21:41
06/29/11 21:41
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
For those interested, this is a fantastic winsock2 tutorial.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: TCP with multiple clients [Re: JibbSmart] #382577
09/09/11 16:48
09/09/11 16:48
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Finally, (sorry for triple post) this is a fantastic supplement to the above tutorial. The first tutorial is the easiest, but a bit silly at times. This tutorial has some useful extra information, and will help you get past the first tutorial's silliness.

For example, the first tutorial loops through all sockets to see which one sent data. This is inefficient and unnecessarily complicated. The second tutorial takes advantage of the fact that wParam tells you exactly which socket is sending you information.

Jibb

Last edited by JibbSmart; 09/09/11 16:59.

Formerly known as JulzMighty.
I made KarBOOM!

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