Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 13

NEUTRON NETWORK LAN MESSENGER

PROJECT REPORT

NEUTRON NETWORK SERVER AND CLIENT WINDOW

Overview
Neutron Network LAN Messenger is an easy-to-use LAN messaging application for effective intra-office communication. It comes with a variety of handy features such as message notification alarms, personal or group messaging, file transfer and an intuitive interface. Absolutely no limitations of si e and type for the files you would like to transfer. A powerful client-server easy for maintenance while keeping the setup and other options to an absolute minimum, re!uiring minimum intervention from an I" staff.

Introduction
Soc et In computer networking, an Internet socket or network socket is an endpoint of a bidirectional inter-process communication flow across an Internet #rotocol-based computer network, such as the Internet. "he term Internet sockets is also used as a name for an application programming interface $A#I% for the "&#'I# protocol stack, usually provided by the operating system. Internet sockets constitute a mechanism for delivering incoming data packets to the appropriate application process or thread, based on a combination of local and remote I# addresses and port numbers. (ach socket is mapped by the operational system to a communicating application process or thread. A socket address is the combination of an I# address $the location of the computer% and a port $which is mapped to the application program process% into a single identity, much like one end of a telephone connection is between a phone number and a particular e)tension line at that location. Soc et !t"te! "nd t#e C$ient%Server &ode$ &omputer processes that provide application services are called servers, and create sockets on start up that are in listening state. "hese sockets are waiting for initiatives from client programs. *or a listening "&# socket, I# Address and the remote port number is re!uired. A "&# server may serve several clients concurrently, by creating a child process for each client and establishing a "&# connection between the child process and the client. +ni!ue dedicated sockets are created for each connection. "hese are in established state, when a socket-to-socket virtual connection or virtual circuit $,&%, also known as a "&# session, is established with the remote socket, providing a duple) byte stream. A server may create several concurrently established "&# sockets with the same local port number and local I# address, each mapped to its own server-child process, serving its own client process. "hey are treated as different sockets by the operating system, since the remote socket address $the client I# address and'or port number% are different.

Soc et 'ro(r"&&in(
-ocket programming has two parts. I. -erver II. &lient. I) Server "o start server need to follow some steps, these are. i. *irst create an I#(nd#oint /e.g. I#(nd#oint ip(nd 0 new I#(nd#oint$I#Address.Any, port%12 ii. &reate a socket ob3ect. /-ocket sock 0 new -ocket$Address*amily.InterNetwork, -ocket"ype.-tream, rotocol"ype.I#%12 iii. 4ind socket with I#(nd#oint. /sock.4ind$ip(nd%12 iv. #lace socket in Listen mode $to accept call of client% /sock.Listen$ma)&lient5eceived%12 v. 6hen any call comes from client Accept that call. /-ocket client-ock 0 sock.Accept$%12 At that position Accept$% return a new socket to continue communication with called client. 4y that socket &lient--erver communication continue. "o send some data $in byte array form% to client from server 3ust write client-ock.send$byteArray7ata%1 "o receive client data 3ust write int receivedLen0 client-ock.5eceive$client7ata%1 5eceive$% function reads data in byte array form from client socket and writes to 8client7ata8 array, and return integer value how much bytes has received.

II) C$ient 9ou have to follow 3ust few steps these are. i. &reate an I#Address ob3ect with -erver I# using 7ns. I#Address /2ipAddress0 7ns.:et;ostAddresses$<localhost<%1 ii. Again built an I#(nd#oint with that I#Address with same port of server. I#(nd#oint ip(nd 0 new I#(nd#oint$ipAddress/=2, >?>?%1 iii. Now creates a socket ob3ect with three parameter like code. -ocket client-ock 0 new -ocket$Address*amily.InterNetwork, -ocket"ype.-tream, #rotocol"ype.I#%1 iv. Now create a byte array to send data to server. v. *inally send that byte array to server. client-ock.-end$client7ata%1 vi. "o receive data from server 3ust wait socket using 5eceive function, when some data received by client socket then it fill a byte array and return a integer value received bytes length. int len 0 client-ock.5eceive$server7ata%1 vii. Now close the client socket. Note. -trictly speaking, you8re supposed to use shutdown on a socket before you close it. "he shutdown is an advisory to the socket at the other end.

A$(orit#&! or De!cri'tion o* &et#od! u!ed in 'ro+ect


Connection!
,) C$ient % Server Connection Initially -erver is set to listening state. A "&# socket for server is made alive for listening. &lient is then allowed to make connection with the server. It creates a "&# client socket and connects to server. "here is no limit for number of clients.

Noti*-in( U!er! w#en " '"rticu$"r U!er Si(n in In Neutron Network Messenger, when client is successfully connected to server. All the other online users are informed of the arrival of the incoming user at server.

.u$$etin Me!!"(in( In Neutron Network Messenger, bulletin messages are sent through server among clients. -erver routes the message to different users. If a particular user is online, it receives message at once while offline users gets notified when they are signed in. "his type of messaging is very popular in @ffices and @rgani ations. A single piece of information is sent to multiple number of users. -erver can too send messages to different &lients.

.u$$etin Me!!"(e Sent .u$$etin Me!!"(e Received

/) Peer to 'eer Connection) &lients themselves are connected with peer to peer connections. An additional -ocket is reserved for receiving data from other users. A "&# socket is maintained for that purpose. A -ocket with a #ort number $ne)t to the one connected to server% is set to listen state. -ince all the other clients know the addresses of each other, therefore they can connect among themselves. Another &lient -ocket is created when a particular &lient wants to create a peer to peer &onnection with another &lient. "he -ender &lient sents a re!uest for peer to peer connection is accepted by the listener client. (ach time when sender client connects with another client, a "&# client socket is created.

In Neutron Network messenger, this type of connection between two clients is used for the e)change of data in terms of "e)t Messages, #assword #rotected messages and file transfer between them. Te0t Me!!"(in( @nline te)t chat is accomplished using the above peer to peer connection. "wo users can communicate with each other for e)change of views.

P"!!word Protected Me!!"(in( "his password protected message scheme is used for sending secret messages. No other +ser can read the message without the permission of the receiver. "he message gets viewed only when the receiver enters his'her accountAs password successfully. +ser is asked to enter password when he'she wants to view the message. 1i$e Tr"n!*er

*irst read the file $slice wise% and store a slice data in a buffer $byte array%. ItAs re!uired because "&# buffer is limited so if we try to send a large data then we will get "&# buffer overflow error. -end these buffered data to receiver client using "&# socket. "he temporary buffer then appends the sliced file and merges it into a single file.

Entit- Re$"tion!#i' Di"(r"& 2ERD3

D"t"4"!e T"4$e!

1uture deve$o'e&ent
In the *uture we will implement the standard techni!ues of messaging i.e. all message e)changes will be protected by the A(- encryption algorithm. ,oice chat B audio streaming should be implemented. @ffline messages will be made available to view

Pr"ctic"$ A''$ic"tion!
*or most mid-si e companies with networks linking up to >=== computers, this software is the optimum solution for messaging and files transfer, practically replacing corporate e-mail. *iles transfer $ as attachments %, sending messages to the offline clients and other useful features such as 4ulletin messages, *ast replies and *ast messages.

Re*rence!
.oo ! Lin ! http.''socketprogramming.blogspot.com Network #rogramming in .N(" 6ith &C and ,isual 4asic .N(" 4y *iach 5eid &C D.=, "he &omplete 5eference 4y ;erbert -childt

So*tw"re "nd 5"rdw"re Re6uire&ent

,isual &C D==E -FL server D==> Infragistics NetAdvantage D==G

You might also like