Reference Socket Used by Socket Manager from My Parser Possible?

Here developers can talk about how to write a Parser for LogMX

Moderator: admin

Post Reply
rmitola
Posts: 17
Joined: Mon Jun 08, 2015 7:08 pm

Reference Socket Used by Socket Manager from My Parser Possible?

Post by rmitola »

Hello. I need to use certain information from the socket being used by the socket manager in my parser. I could not determine from the API if this would be possible or not. Is there something I can do to reference the socket from my parser rather than write a whole new manager?

If writing my own manager is the only solution, is it possible to create a copy of the socket manager I can edit? I have not found any source code for any managers other than the sample one, and it would be a lot easier to just make the socket referable rather than create a whole new socket manager.

Thanks!
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: Reference Socket Used by Socket Manager from My Parser Possible?

Post by admin »

Hello,

From your Parser, you can use LogMXAPIUtils.html.getOpenedFilesLogManagers() to get the SocketManager, but since this Manager uses many internal classes, the Java "Socket" object itself is not directly referenced by this Manager. I guess you can still access it using Java reflection and a decompiler, but this is clearly not something we encourage, that's why LogMX Java code is obfuscated. By the way, each LogMX release is not obfuscated the same way, so the Socket variable may be named "kN" in the current release then "pA" in the next one... So each LogMX upgrade will require you to also update your Parser.

Please note that if you have purchased at least one license, we can provide you with specific developments and/or API new features.

In any case, if you tell me what is your specific need, I may be able to help you further with what you already have.

Xavier
rmitola
Posts: 17
Joined: Mon Jun 08, 2015 7:08 pm

Re: Reference Socket Used by Socket Manager from My Parser Possible?

Post by rmitola »

It looks like it would be best to write my own manager then. I had attempted to use LogMXAPIUtils and ran into that roadblock you mentioned. My organization has purchased a license and I am currently using the Pro edition. If you could provide the socket manager .java for reference that would be great, but if not that is okay as I can just make my own and post any questions I have about it on this same topic.
rmitola
Posts: 17
Joined: Mon Jun 08, 2015 7:08 pm

Re: Reference Socket Used by Socket Manager from My Parser Possible?

Post by rmitola »

Does this mean I will run into problems attempting to establish my own socket object (i.e. are connections to LogMX handled internally and only internally?) or is it just your specific socket manager that utilizes this?
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: Reference Socket Used by Socket Manager from My Parser Possible?

Post by admin »

As I said, the SocketManager class relies on many internal classes, so this SocketManager class itself is very small, it will not help you that much if you had just this code. But if you tell me if you are interested in TCP or UDP, and if you are interested in receiving text only or binary data through the socket, I will send you some code by e-mail (address specified in your forum profile) to help you in writing your Manager.
rmitola
Posts: 17
Joined: Mon Jun 08, 2015 7:08 pm

Re: Reference Socket Used by Socket Manager from My Parser Possible?

Post by rmitola »

That would be very helpful, thank you. Please do send me the email.
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: Reference Socket Used by Socket Manager from My Parser Possible?

Post by admin »

Please tell me before if you want to use TCP or UDP, and if you want to receive raw text or binary data through this socket, the implementation greatly depends on these two elements.
jobemakar
Posts: 27
Joined: Thu Jun 11, 2015 9:49 pm

Re: Reference Socket Used by Socket Manager from My Parser Possible?

Post by jobemakar »

Hi Xavier - thanks for the assistance. Rmitola reports to me for this work and so I can give you a little context on what we're trying to achieve. Sorry if I hijack the thread.

Licenses
First - yes, we are a license holder. We have a 5-user license. If we are successful with what we're trying to achieve, then we'll roll this solution out to potentially dozens of developers and QA people internally.

UDP vs TCP
UDP is not an option as a primary solution. We are logging from a Flash browser-based client as one of the source clients. Flash does not support UDP int he browser. Plus UDP doesn't guarantee packet delivery unless we go with RUDP. We may eventually want to use UDP from our mobile client to burst the local network to find the internal IP of all LogMX clients that are running.

Typical use case
We commonly need to log from multiple clients on the same machine simultaneously. With the default socket manager it seems that we'd have to manually open one tab per client (with a unique port), and then direct each client's logs to each port. While that is doable, it is cumbersome.

Ideally, LogMX would create a new tab for us on each inbound connection. My understanding is that is not possible. So the next best would be for LogMX to allow multiple TCP connections simultaneously per tab, and allow us to distinguish and filter logs per connection. The client could do some initial handshake and provide a unique id if that helps.

@rmitola told me that the TCP manager will only accept a single connection at once. If we write our own LogManager will we be able to to support multiple connections per SocketServer instance? I know Java supports it as well as Flash.
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: Reference Socket Used by Socket Manager from My Parser Possible?

Post by admin »

Hello,

I confirm you that, at this time, LogMX SocketManager can listen to only one incoming connection (same for TCP and UDP). But listening to multiple incoming connections to the same unique port would be indeed technically possible in LogMX, and that is what we will implement in the next release since you (and maybe other users) need to do this. Do you have any due date for this need? On our side, the next LogMX release (that will include this feature) is currently planned for mid-July.

If you still need to write your own Manager (even if LogMX SocketManager can listen to multiple incoming connections), please let us know, we will send you by e-mail some code that will help you implementing it.

Xavier
rmitola
Posts: 17
Joined: Mon Jun 08, 2015 7:08 pm

Re: Reference Socket Used by Socket Manager from My Parser Possible?

Post by rmitola »

A mid-July release will be fine; thanks for taking these concerns into consideration for the release. However, please do send me the code, as we are still going to try and create a manager to suit any alterations we need to make.

Thanks for all the help!
rmitola
Posts: 17
Joined: Mon Jun 08, 2015 7:08 pm

Re: Reference Socket Used by Socket Manager from My Parser Possible?

Post by rmitola »

Oh, and I forgot to mention we are receiving raw text. As @jobemakar stated, TCP is our protocol.
Post Reply