Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Networking/Comms between Windows App and AGK

Author
Message
marvin944
10
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 15th Nov 2019 15:04 Edited at: 15th Nov 2019 15:14
Hi!

I want a communication channel between a Windows Application (I wrote) and AppGameKit but ON THE SAME MACHINE. Thet need to exchange values (strings). I was wondering if this is doable with networking/mulitplayer, but have no clue how compatible AppGameKit is with protocols in .NET.
Does anyone have some examples or ideas on how to achieve this?

I am assuming an UDPListener would be best?
Dutch
marvin944
10
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 15th Nov 2019 15:31 Edited at: 15th Nov 2019 15:31
SOlved my own problem:

VB.NET code (sender):

Dim udpClient As New UdpClient
Dim GLOIP As IPAddress
Dim GLOINTPORT As Integer
Dim bytCommand As Byte() = New Byte() {}
GLOIP = IPAddress.Parse("169.254.228.164")
GLOINTPORT = "22368"
udpClient.Connect(GLOIP, GLOINTPORT)
bytCommand = Encoding.ASCII.GetBytes("hello world")
udpClient.Send(bytCommand, bytCommand.Length)

AGK code:

function Checkcomms()
msgID = GetUDPNetworkMessage( 1 )
if ( msgID )
DeleteNetworkMessage( msgID )
lastmsgID = msgID
Message(str(lastmsgID))
endif
endfunction
Dutch

Login to post a reply

Server time is: 2024-04-19 17:47:05
Your offset time is: 2024-04-19 17:47:05