Grease/ENET not working

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Substance12
Prole
Posts: 19
Joined: Fri Dec 11, 2015 7:01 pm

Grease/ENET not working

Post by Substance12 »

I've been messing around with Grease and I got both a TCP and UDP client/server working, but I can't manage to get it's ENET implementation working. A code as simple as this:

Code: Select all

server = grease.udpServer()

        server.handshake = "handshake"
        server:setPing()
        server:listen(1337)

Code: Select all

client = grease.udpClient()

        client.handshake = "handshake"
        client:setPing()
        client:connect("localhost", 1337)
Plus the update(dt) functions, will work perfectly, but the ENET implementations (enetClient and enetServer) won't work at all. The client just won't connect and I have no idea why. I have looked onto other ENET examples and they all seem to be basically the same...
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Grease/ENET not working

Post by bartbes »

What are the return values of connect? Does it indicate an error?
Substance12
Prole
Posts: 19
Joined: Fri Dec 11, 2015 7:01 pm

Re: Grease/ENET not working

Post by Substance12 »

Ah, yes, it returns err, "Could not connect"
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Grease/ENET not working

Post by bartbes »

Unfortunately enet doesn't really seem to provide any information as to why this is happening. Do you launch the server before the client? Is something else using udp port 1337, or has it in the last few minutes?
Substance12
Prole
Posts: 19
Joined: Fri Dec 11, 2015 7:01 pm

Re: Grease/ENET not working

Post by Substance12 »

Yeah, server is launched before the client. I have tried switching the update(dt) functions so the server updates before the client and vice versa but I get the same result.

I used netstat and noticed that the 1337 port is used both with an UDP and ENET server when the game is launched, so, at least the server works.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 7 guests