0

Can I implement a BSD client socket program using web browser and javascript that would communicate with an embedded web server BSD socket program running in a microcontroller programmed in C to transfer large files? If so, should I be looking at socket.io or where do I start (I'm a beginner javascript programmer)? And will the programming be as straightforward as BSD client server socket program interaction in C?

Thanks. Jay

1 Answer 1

1

Well Well That's lots of questions.

  • First Browser's sandbox model doesn't allow to do so
  • Coming to socket programming, you can use flash sockets (Chances are high this will be deprecated shortly)
  • You can use chrome extension sockets to connect to tcp sockets, but again this will be deprecated shortly.
  • socket.io is javascript library for websockets which is duplex communication over http.

So I would like to sum it up as of now you can't connect to tcp sockets through javascript in browser but yes you can do so using nodejs which doesn't run in browser.

Sign up to request clarification or add additional context in comments.

3 Comments

"you can use flash sockets" - or a Java applet (also similarly deprecated)
@RemyLebeau Java Applets are history now :), but some browser versions still support flash sockets!!
Thanks Mukesh for the response. I have actually been able to figure something out. I broke the file into chunks in javascript using slice and transferred chunks using Ajax. It worked fine with Chrome, but with edge, it was really slow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.