Jump to content

Error with Sockets


Recommended Posts

Posted

Hey guys, I am trying to get socket to work, but getting this error on server side

any pointers ?

 

	ERROR][04/13 12:16:34 PM]: Uncaught exception!
java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:14444" "listen,resolve")
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at org.osbot.SA.checkPermission(xg:280)
    at java.lang.SecurityManager.checkListen(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at SocketMule$server.run(SocketMule.java:45)
    at java.lang.Thread.run(Unknown Source)
 
	

Posted
3 minutes ago, whipz said:

What doesnt make sense ? and can I use a socket to connect to a standalone then ? its for muling at this stage, but I want to add more to it

A server by definition should have high uptime, not even the runescape game meets a minimum of 99% uptime requirement. Consider writing an actual server application. 

  • Like 1
Posted (edited)

Yes, if you want to communicate with multiple accounts you should have one server application that is using ServerSocket, like Token said. You can then use Socket to connect to that server application (hosted on some server) in which you wanna have logic that can relay a message to the client you want. E.g. Client1 -> Server -> Client2. I'd probably use some small framework though, that already handles all connections etc. otherwise it's pretty time consuming to write. You could use kryonet for this in which you want to send with TCP, or you can use another protocol entirely, called websocket (which is especially useful if you ever want to build a webinterface around it): https://github.com/TooTallNate/Java-WebSocket

Edited by Reveance
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...