Solved

http listener url and port

Posted on 2013-05-15
8
393 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 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39169013
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
ID: 39171190
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
ID: 39171379
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
ID: 39171436
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 83

Expert Comment

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

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 500 total points
ID: 39172049
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
ID: 39172273
Thanks guys
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39172322
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Get id from json Data with NewtonSoft 3 35
ADO.NET ENTITY DATA MODEL 3 32
Syntax Error 2 47
compare between entities in entity framework 8 12
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…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

27 Experts available now in Live!

Get 1:1 Help Now