So I recently started learning about Sockets and network programming in Java as I hope to add it into a game but I'm unsure how I would implement it, I was thinking of having it so you would type in the IP of the player you wish to connect to and then you would appear in the players "world", is this even possible or are there easier/more efficient ways? I am also curious how I would send player data, would I just use Object streams?
Sorry If I'm not being clear and sound like a newbie but I'm kind of new to networking
I've read the oracle tutorials/documentation and understand the basics of sockets/server sockets.
Depends an what you wan't to do.
If you just want to make a multiplayer game, use KryoNet (Its written like this I think).
If you want to learn how the networking works exactly: Don't use Object-Streams, as they are way too slow.
I for myself have my own networking library, but I think its better if you use a complete library like KryoNet,
since a complete library is more easy to use, cleaner, and mostly free of bugs.
(Don't get me wrong: Every library has its bugs, some are better, some are worse)
I hope I didn't confuse anyone with this post.
Any mistakes/fails/errors are due to 4 hours of work in the garden today.