matSock

버전 1.3.0.0 (31.7 KB) 작성자: Jude Collins
non blocking tcpip event based sockets for Matlab.
다운로드 수: 688
업데이트 날짜: 2012/8/28

라이선스 보기

A small java class that implements a channel multiplexor in a separate thread and allows you to register socket connections and Matlab callback functions for socket channel events (OP_READ and OP_ACCEPT). Leaves the command prompt available for you to keep working while it runs in the background firing Matlab callbacks to process the data. The SocketChannel that causes the event is passed into the Matlab callback in the event data. There is no need to open multiple instances of Matlab to test it. I have included an echo server for testing.

I get data rates >100Mbps.

Usage:
For a complete example see "main.m" and "demoServer.m" in the attached files.

Installation:
You will need to edit your "classpath.txt" (type 'edit classpath.txt' at the matlab command prompt) and add the path to the bin directory that contains the java classes from the zip file.

It should look something like this when you are done:
...
glnxa64=$matlabroot/java/jarext/jogl.a64.jar
$matlabroot/java/jarext/jogl.jar
C:/MatSock/bin/
mac=/System/Library/Java
maci=/System/Library/Java

You then MUST restart Matlab.

The class files were built on my Windows 32 bit machine against Java 1.5.0_07.

I have included the source code so that you can compile the code yourself on your own system if you desire. I suppose that this is necessary if you are running 64 bit.

This submission was inspired by my job and enabled by the useful information on UndocumentedMatlab.com. Particularly this post:
http://undocumentedmatlab.com/blog/matlab-callbacks-for-java-events/

There is still a lot of work to be done to make it more configurable and implement all of the network options but what is there seems to run well.
Try it out and let me know what additional features would be helpful.... and leave me a comment to let me know what you think.

인용 양식

Jude Collins (2024). matSock (https://www.mathworks.com/matlabcentral/fileexchange/35608-matsock), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Java Package Integration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.3.0.0

Added in the serverBind() m-file that was left out last time I uploaded it. Made a few other tweaks.

1.2.0.0

Included the java source code so that you can build the class yourself.

1.1.0.0

Implemented the OP_ACCEPT callback for server sockets.
Expanded the "main.m" demo file.
Added a "demoServer.m".
msgSizePosition indicator is registered per socket.

1.0.0.0