Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

http listener url and port

Posted on 2013-05-15
8
398 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

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
 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…

856 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