Solved

http listener url and port

Posted on 2013-05-15
8
389 Views
Last Modified: 2013-05-16
I need to build a listener that grabs all traffic coming into our network from

A particular url
A specific port.
0
Comment
Question by:lrbrister
  • 3
  • 3
  • 2
8 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
If this is the same project, you need to find out if and where you can actually see that traffic.  Two tools that can help you determine what is going on are TCPView http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx from Microsoft Sysinternals and Wireshark http://www.wireshark.org/.  If you can't see it, you can't grab it.  The only place you can 'guarantee' that you can see it is at your 'gateway' device which is your incoming router or modem, a place that All the traffic goes thru.
0
 

Author Comment

by:lrbrister
Comment Utility
DaveBaldwin

The VOIP folks we're dealing with has a Java based jar that works like a listener and can be executed from my dev PC's command prompt.

So, that seems to me that I can grab it as well.


I have Eclipse so I can look at the source code.

The source Java essentially connects to their url (First yellow highlight)
Does a "PrintIn" that lets me know it's monitoring (Second yellow highlight
And then when something happens Prints the data to screen with a PrintIn as well...which COULD be sent to a database with a PrepareDOcument process in Java. (third yellow highlight)

I'm essentially trying to replicate that in .Net
And my director has stated he wants it done with a Listener in .Net

And I have ZERO experience with a Listener.

ss
0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
I do not have a lot of experience with Java but it appears that VOIP guys have their own Library(M5Connection). Have you asked them to see if they have .NET libraries?
0
 

Author Comment

by:lrbrister
Comment Utility
CodeCruiser

Yeah...they have it for Professional Fees wich my company doesn't want to pay for.

I have 5 weeks to figure this out.

I've done this with Asterisk.Net elsewhere...
But management is insisting this be done this way.  Making me crazy.

I DO have the code for the connection...in Java of course.

Looks like I'll just have to clomp my way through this.

The code below is how the Java code begins...
I'll probably be making a lot of Java to C# to VB.Net conversions...with EE questions.

And so the journey begins.

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;
import java.net.URL;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;

import javax.net.SocketFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

/**
 * This class is used to connect to M5 API servers and send
 * commands and receive responses as XML fragments using HTTP1.1
 * chunked encoding.
 */
public class M5Connection
{
	public static final String urlBase = "/bobl/bobl";
	public static final String ENCODING = "ISO-8859-1";
	public static final String DELIMITER = "\r\n";
	protected URL url;
	private InputStream inputStream;
	protected OutputStream outputStream;
	protected Socket socket;
	protected BufferedReader reader;
	private boolean bProcessedHeaders;

	protected String resp = null;
	protected String errorMessage = null;

Open in new window

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Ah so you have code for M5Connection class. Then its a matter of converting it to .NET. Good luck.
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 500 total points
Comment Utility
At least you have something to work with.  Have you seen the TCPClient and TCPListener class code on this page: http://msdn.microsoft.com/en-us/library/sb27wehh%28v=vs.71%29.aspx
0
 

Author Closing Comment

by:lrbrister
Comment Utility
Thanks guys
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
You're welcome, thanks for the points.  That must be some expensive software for them to want to pay you for 5 weeks instead of buying the code.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Vb.Net Menu 1 21
.NET Error 7 42
Hovering effect 9 28
Redacting a row in Excel based on a term. 17 31
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now