Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steam Networking Sockets - Basic Implementation #138

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

tylerhasman
Copy link

No description provided.

@Osaris31
Copy link

Osaris31 commented Sep 13, 2024

@tylerhasman there is a typo in this function:

public int receiveMessagesOnPollGroup(int pollGroupHandle, SteamNetworkingMessage[] messages){
     return SteamNetworkingSocketsNative.receiveMessagesOnConnection(pollGroupHandle, messages, messages.length);
}

Should be:
return SteamNetworkingSocketsNative.receiveMessagesOnPollGroup(pollGroupHandle, messages, messages.length);

Otherwise this works but I'm a bit concerned about performance and memory seeing that creation of
jbyteArray javaByteArray = env->NewByteArray(netMessage->m_cbSize);
for each message, instead of somehow re-using a buffer.

Also, sendMessageToConnection could come with a way to have an offset for its buffer, like sendP2PPacket does.

Anyway, thanks a lot for your work!

@tylerhasman
Copy link
Author

@tylerhasman there is a typo in this function:

public int receiveMessagesOnPollGroup(int pollGroupHandle, SteamNetworkingMessage[] messages){
     return SteamNetworkingSocketsNative.receiveMessagesOnConnection(pollGroupHandle, messages, messages.length);
}

Should be: return SteamNetworkingSocketsNative.receiveMessagesOnPollGroup(pollGroupHandle, messages, messages.length);

Otherwise this works but I'm a bit concerned about performance and memory seeing that creation of jbyteArray javaByteArray = env->NewByteArray(netMessage->m_cbSize); for each message, instead of somehow re-using a buffer.

Also, sendMessageToConnection could come with a way to have an offset for its buffer, like sendP2PPacket does.

Anyway, thanks a lot for your work!

Oh shoot that would explain why poll groups weren't working. Thank you I will update this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants