Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Search the Community

Showing results for tags 'tcp'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • OpenComputers
    • Announcements
    • Feedback
    • IRC
  • Code Central
    • Support
    • Showcase
    • Tutorials
  • Addons & More
    • Addons Mods
    • Architectures
    • OpenEngineering Task Force
  • General
    • Lounge
    • Forum Games
    • Showcase
    • Servers
  • Archives
    • Public Archives

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Minecraft


GitHub


IRC


Fediverse ID


Location


Interests

Found 3 results

  1. Hello everybody, I'm trying to connect my OC's computer to my tcp server with the first example here http://ocdoc.cil.li/api:internet local internet = require("internet") local handle = internet.open("example.com", 1337) local data = handle:read(10)------------------------- I REMOVED THIS LINE handle:write("1234") handle:close() , but my server don't receive the message. I tested with a "real" socket client, and my server is working well. Is the code shown in link is outdated or i'm missing something ? OC version: 1.7.1.1127-universal MC version: 1.7.10 Thanks in advance for help
  2. The Roboserver is a program which lets you control OpenComputers robots remotely, without writing any Lua code, either from your web browser or from a desktop application. You can have your robots dig tunnels, build houses, craft items, and just about anything else a player can do, from any distance! I've got many interesting ideas for how to improve it still, such as adding support for ComputerCraft turtles, allowing robots to save and place structure blueprints, and controlling them from AR glasses added by other mods. If you're as excited about this as I am, help me get there by becoming a patron here! The code for this project will always be open source, and can be found here.
  3. Congon4tor

    TCP Server

    Had some trouble getting a TCP connection between an OpenComputers program (client) and a java program (server), so I thought I could sare this. Here is the lua program: --VARIABLES local event = require("event") local net = require("internet") local term = require("term") local os = require("os") local running = true local con = net.open("192.168.1.100", 6667) --FUNCTIONS function sendString(s) con:write(s) print('Sending ' .. string.sub(s,1,s:len()-1) .. ' to server...') con:flush() end function reciveString() local s = con:read() print('Recived ' .. s .. ' from server...') con:flush() end --MAIN if con then print('Connected to the server!') end while running do local s = term.read() sendString(s) reciveString() os.sleep(0) end And here the java code: import java.io.*; import java.net.*; class TCPServer { public static void main(String argv[]) throws Exception { String clientSentence; String capitalizedSentence; ServerSocket welcomeSocket = new ServerSocket(6667); Socket connectionSocket = welcomeSocket.accept(); while (true) { if (!connectionSocket.isConnected()) { connectionSocket = welcomeSocket.accept(); } else { System.out.println("Connected to client"); BufferedReader inFromClient = new BufferedReader( new InputStreamReader(connectionSocket.getInputStream())); clientSentence = inFromClient.readLine(); System.out.println("Received: " + clientSentence); capitalizedSentence = clientSentence.toUpperCase() + "\n"; DataOutputStream outToClient = new DataOutputStream(connectionSocket.getOutputStream()); System.out.println("Sending: " + capitalizedSentence); outToClient.writeBytes(capitalizedSentence); } } } } Also make sure you have TCPEnabled on the config file and if your tcp server is in the same machine as the minecraft serve remove form the ip blacklist your networks ip. Hope this helps someone
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.